Debian
Tips for installing a Debian/Devuan VM on a BSD bare metal server running vmd
Version information
-
Debian 10.4.0
-
Devuan 3.0.0
-
OpenBSD 6.7
-
18/6/2020
On BSD bare metal server running vmd:
Logging on:
ssh user@furit.ircnow.org
vm configuration
grep -B1 -A10 "owner USERNAME" /etc/vm.conf`
`vmctl status | grep USERNAME`
making virtual disk
vmctl create -s 16G diskname.qcow2
file diskname.qcow2
ls -lh diskname.qcow2
controling vm
Start: %25%25vmctl start VMNAME%25%25\
Get in: %25%25vmctl console VMNAME%25%25\
Start and get in: %25%25vmctl start -c VMNAME%25%25\
Get out: %25%25
Get out without get out ssh: %25%25
Graceful shutdown: %25%25vmctl stop VMNAME%25%25\
Cut Power: %25%25vmctl stop -f VMNAME%25%25\
Console messes up the screen: %25%25reset; clear%25%25\
vm booting
-
Guess - MBR (no GPT) of diskname.qcow2
-
If invalid, cdrom
-
Can’t be controlled without root or something idk ’bout
===== Inside my vm =====
Boot parameters
Bad:
/install.amd/vmlinuz priority=low vga=788 initrd=/install.amd/initrd.gz
Good:
/install.amd/vmlinuz priority=low DEBIAN_FRONTEND=text initrd=/install.amd/initrd.gz --- console=ttyS0,115200
Guesses:
-
system no like video
-
system no auto find console or console speed
-
parameter after — will be copied to system boot menu
-
curses frontend crashes console
=== References: ===
-
Debian Boot Parameters https://www.debian.org/releases/stable/amd64/ch05s03.en.html
-
Console Crashes For No Reason https://marc.info/?l=openbsd-tech&m=159028442625596&w=2
Installation
Initial Menu
Advanced options >> Expert install >>
Protip: Type line at end, then Ctrl+B to edit middle - don’t overshoot#
Pre network questions
Defaults are fine.
Network questions
No autoconfigure.
Static IP address assigned to you hint: %25%25dig VMNAME.us5.ircnow.org%25%25
Netmask: 255.255.255.0 (default)
Gateway: 38.81.163.129 (NOT default)
DNS: 8.8.8.8 (NOT default)
Timeout for link autodetect - efault of 3 is fine. It never times out anyway if you got it wrong and hangs.
Protip: You can never enter the network setup menu (or type < to get out of it) to avoid this.
Hostname: Don’t think it matters.
Domain name: does it have to be us5.ircnow.org???
Pre disk questions
Protip: ##STARTCODEBLOCK## openssl rand -base64 12##ENDCODEBLOCK## makes a 16 char password
Protip: Save password to a file on bare metal computer and copy paste it in
Protip: Ctrl+c or Ctrl+shift+c = xsel -b ; Select with mouse = xsel ; Middle mouse button pastes xsel
Protip: Can’t only have ssh key because you need to login from console when network is down!
Protip: ##STARTCODEBLOCK## grep "Invalid user" /var/log/auth.log | wc -l##ENDCODEBLOCK##
Disk questions
Protip: mbt is called “msdos” here\
Reminder: GPT no work### i think\
Protip: ##STARTCODEBLOCK## expr 1024 * 1024 * 1024 * 4%25%25##ENDCODEBLOCK## to get 4GiB instead of 4GB, use suffix b
Protip: “10 11”
Protip: easier to make swap on a separate .qcow2
Final questions
Protip: “targeted” works
Enable backports with “1 2 3”
Select and install software takes a long time do NOT press enter to make it wake up or it will skip choices
Don’t install desktop stuff on the SERVER
Install GRUB to the MBR
You don’t need to “remove the installation media”
Post installation
Protip: Don’t hold keys down or you may lock the console
To keep all .dpkg (to make a local archive later):
printf '%25s' 'Binary::apt::APT::Keep-Downloaded-Packages "1";' > /etc/apt/apt.conf.d/99keep-downloaded-packages
To trust cdrom:
sed -i 's/deb cdrom/deb [trusted=yes] cdrom/' /etc/apt/sources.list
To get new kernel: (IMPORTANT!)
apt list | egrep 'linux-image.*bpo..-amd64-unsigned'
#based on latest above
apt install linux-image-5.6.0-0.bpo.2-amd64-unsigned
uname -r #still old
reboot
uname -r #new
Now you put your authorized_keys in and switch to ssh instead of console.
To see kept .dpkg (to make a local archive later):
find /var/cache/apt/archives -name '*.deb' | wc -l
du -ah /var/cache/apt/archives | sort -h | tail
To find an empty .qcow2 disk to put swap on:
lsblk
mkswap /dev/DONT_GET_THIS_WRONG
lsblk -o name,UUID | grep DONT_GET_THIS_WRONG
uuid=$(lsblk -o name,UUID | grep vdc | awk '{print $2}')
echo \$uuid #should exist!
printf "%25s\n" "UUID=$uuid none swap" >> /etc/fstab #applies on reboot
swapon /dev/DONT_GET_THIS_WRONG #applies now
swapon #verify have swap now
To not need password to sudo
/etc/sudoers #edit this file with this line
USERNAME ALL=(ALL:ALL) NOPASSWD:ALL
===== Packages =====
apt get apt-file