1. Uninstallation
-
Log in as delta on the tbhf-kvm-mrm server.
-
Enter the following commands at a Command Line.
sudo ls -al /home/kvm/images sudo ls -al /home/delta/images sudo virsh list --all sudo virsh shutdown <vm> # Graceful shut down. sudo virsh list --all sudo virsh destroy <vm> # Forced shut down. sudo virsh undefine --domain <vm> --remove-all-storage sudo virsh list --all sudo ls -al /home/kvm/images sudo ls -al /home/delta/images
2. Installation
-
Todo: Make console window larger.
-
Log in as delta on the tbhf-kvm-mrm server.
-
Enter the following commands at a Command Line.
# Create virtual machine in root space. # Create virtual machine in user space. virt-install \ --disk format=qcow2,path=/home/delta/images/tbhf-anc-mrm.qcow2,size=100 \ --extra-args "console tty0 console=ttyS0,115200n8 serial" \ --graphics none \ --location http://deb.debian.org/debian/dists/stable/main/installer-amd64 \ --memory 2048 \ --name tbhf-anc-mrm \ --network bridge=br0 \ --os-variant debian11 \ --vcpus 1 \ --virt-type kvm
-
Step through the installation with the following choices.
-
Language: English
-
Country, territory or area: other
-
Continent or region: Asia
-
Country, territory or area: Thailand
-
Country to base default locale settings on: United States - en_US.UTF-8
-
Keymap to use: American English
-
Hostname: tbhf-anc-mrm
-
Domain name: smru.shoklo-unit.com
-
Debian archive mirror country: Thailand
-
Debian archive mirror: deb.debian.org
-
HTTP proxy information (blank for none): http://10.10.1.170:8080
-
Root password: level 1 password
-
Re-enter password to verify: level 1 password
-
Full name for the new user: Delta
-
Username for your account: delta
-
Choose a password for the new user: level 2 password
-
Re-enter password to verify: level 2 password
-
Partitioning method: Guided - use entire disk
-
Select disk to partition: Virtual disk 1 (vda) - 107.4 GB Virtio Block Device
-
Partitioning scheme: All files in one partition (recommended for new users)
-
Partition disks: Finish partitioning and write changes to disk
-
Write the changes to disk? Yes
-
Participate in the package usage survey? No
-
Uncheck Debian desktop environment.
-
Uncheck GNOME.
-
Check SSH server.
Choose software to install: [ ] Debian desktop environment [ ] ... GNOME [ ] ... Xfce [ ] ... GNOME Flashback [ ] ... KDE Plasma [ ] ... Cinnamon [ ] ... MATE [ ] ... LXDE [ ] ... LXQt [ ] web server [*] SSH server [*] standard system utilities -
Choose software to install: Continue
-
Install the GRUB boot loader to your primary drive? Yes
-
Device for boot loader installation: /dev/vda
-
Select Continue to reboot and press Enter.
-
Press Ctrl + ] to quit the KVM guest console.
-
Type
resetand press Enter to reset the terminal.
-
Note: Errors logged in the /var/log/syslog file.
sudo grep -Ei --color=always "bad |brok|cann|crit|deni|err:|erro|fail|igno|insu|leak|lost|miss|not |such|unab|warn" /var/log/syslog
# Using networking.service instead of systemd-networkd.service # Using user space. Apr 6 19:16:22 tbhf-kvm-mrm libvirtd[8230]: internal error: End of file from qemu monitor Apr 6 19:16:22 tbhf-kvm-mrm libvirtd[8230]: cannot parse process status data Apr 6 19:16:22 tbhf-kvm-mrm libvirtd[8230]: Unable to open vhost-net. Opened so far 0, requested 1 Apr 6 19:16:22 tbhf-kvm-mrm systemd-udevd[8375]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
# Using user space. Mar 16 17:40:57 tbhf-kvm-mrm systemd-networkd[303]: tap0: Lost carrier Mar 16 17:40:57 tbhf-kvm-mrm systemd-networkd[303]: rtnl: received neighbor for link '8' we don't know about, ignoring. Mar 16 17:40:57 tbhf-kvm-mrm systemd-networkd[303]: rtnl: received neighbor for link '8' we don't know about, ignoring. Mar 16 17:40:57 tbhf-kvm-mrm libvirtd[1094]: internal error: End of file from qemu monitor Mar 16 17:40:57 tbhf-kvm-mrm libvirtd[1094]: cannot parse process status data Mar 16 17:40:57 tbhf-kvm-mrm systemd-udevd[1220]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable. Mar 16 17:40:57 tbhf-kvm-mrm libvirtd[1094]: Unable to open vhost-net. Opened so far 0, requested 1
# Using root space. systemd-networkd[269]: vnet2: Lost carrier systemd-networkd[269]: rtnl: received neighbor for link '9' we don't know about, ignoring. systemd-networkd[269]: rtnl: received neighbor for link '9' we don't know about, ignoring. libvirtd[144191]: internal error: End of file from qemu monitor libvirtd[144191]: cannot parse process status data libvirtd[145863]: 2022-01-25 03:29:00.694+0000: 145863: warning : virSecurityDACTransactionRun:289 : Ignoring failed restore attempt on /home/kvm/images/tbhf-anc-mrm.qcow2 libvirtd[144191]: internal error: child reported (status=125): unable to stat: /var/lib/libvirt/boot/virtinst-5arewoyl-linux: No such file or directory libvirtd[144191]: unable to stat: /var/lib/libvirt/boot/virtinst-5arewoyl-linux: No such file or directory libvirtd[144191]: Unable to run security manager transaction systemd-udevd[145855]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable. kernel: [11386486.676281] audit: type=1400 audit(1643081342.726:40): apparmor="DENIED" operation="capable" profile="libvirtd" pid=144191 comm="rpc-worker" capability=39 capname="bpf"
SMRUWS-IT07 as tbhf-tst-mrm on port 5 of SMRU-SW01 24p switch. Jan 27 13:02:41 tbhf-tst-mrm systemd-networkd[420]: vnet0: Lost carrier Jan 27 13:02:41 tbhf-tst-mrm systemd-networkd[420]: rtnl: received neighbor for link '4' we don't know about, ignoring. Jan 27 13:02:41 tbhf-tst-mrm systemd-networkd[420]: rtnl: received neighbor for link '4' we don't know about, ignoring. Jan 27 13:02:41 tbhf-tst-mrm libvirtd[622]: internal error: End of file from qemu monitor Jan 27 13:02:41 tbhf-tst-mrm libvirtd[622]: cannot parse process status data Jan 27 13:02:41 tbhf-tst-mrm libvirtd[892]: 2022-01-27 06:02:41.435+0000: 892: warning : virSecurityDACTransactionRun:289 : Ignoring failed restore attempt on /home/kvm/images/tbhf-anc-mrm.qcow2 Jan 27 13:02:41 tbhf-tst-mrm libvirtd[622]: internal error: child reported (status=125): unable to stat: /var/lib/libvirt/boot/virtinst-wge2uf3v-linux: No such file or directory Jan 27 13:02:41 tbhf-tst-mrm libvirtd[622]: unable to stat: /var/lib/libvirt/boot/virtinst-wge2uf3v-linux: No such file or directory Jan 27 13:02:41 tbhf-tst-mrm libvirtd[622]: Unable to run security manager transaction Jan 27 13:02:41 tbhf-tst-mrm systemd-udevd[887]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
libvirtd[####]: internal error: End of file from qemu monitor libvirtd[####]: 3664: warning : virSecurityDACTransactionRun:289 : Ignoring failed restore attempt on /home/kvm/images/tbhf-anc-mrm.qcow2 libvirtd[####]: internal error: child reported (status=125): unable to stat: /var/lib/libvirt/boot/virtinst-gu5fdwbl-vmlinuz: No such file or directory
3. Configuration
-
Log in as delta on the tbhf-kvm-mrm server.
-
Enter the following commands at a Command Line.
# Make vm start on boot. sudo virsh autostart --domain tbhf-anc-mrm sudo virsh list --all --autostart sudo virsh list --all sudo systemctl status libvirtd sudo ls -al /home/kvm/images sudo qemu-img info --force-share /home/kvm/images/tbhf-anc-mrm.qcow2
4. Console
-
Log in as delta on the tbhf-kvm-mrm server.
-
Type
sudo virsh console --domain tbhf-anc-mrmand press Enter. -
Press Enter to log in.
-
Do your thing.
-
Press Ctrl + ] to quit the KVM guest console.
5. VM Configuration
-
Log in as delta on the tbhf-kvm-mrm server.
-
Type
sudo virsh console --domain tbhf-anc-mrmand press Enter. -
Press Enter.
-
Log in as delta on the tbhf-anc-mrm server.
-
Type
ip aand press Enter. -
Note: Temporarily enable DNS and HTTP services for the IP address assigned by the DHCP server on the SMRU-EFW-MRM firewall.
-
Enter the following commands at a Command Line with root privileges.
ip address scp -p delta@10.10.1.2:/media/Windows/Software/_Delta/delta-linux-tools-#.#.#-1-all.deb . dpkg -i delta-linux-tools-#.#.#-1-all.deb delta config apt # Configure apt repositories. delta config bash # Install and configure bash shell for each user. delta install basic-tools # Install basic commands like curl and wget. delta setup cron # Install and configure cron. delta setup editor # Install and set default editor to vim.tiny for each user. delta setup locale # Install and configure locale. delta setup timezone # Install and configure time zone. delta setup inventory # Install and configure inventory. delta setup openssh # Install and configure openssh server. delta setup sudo # Install and configure sudo for each user. delta setup legacy-ethernet 10.10.1.2 10.10.1.170 10.10.1.1 smru.shoklo-unit.com delta setup systemd-ethernet 10.10.1.2 10.10.1.170 10.10.1.1 smru.shoklo-unit.com -
Restart the virtual machine.
-
Press Ctrl + ] to quit the KVM guest console.
-
Log in as delta on the tbhf-anc-mrm server using PuTTY.
-
Note: Disable DNS and HTTP services for the IP address assigned by the DHCP server on the SMRU-EFW-MRM firewall.
-
Enter the following commands at a Command Line.
ip a ip link list sudo systemctl --type service ls -al /etc/resolv.conf cat /etc/resolv.confsudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get autoremove sudo apt-get autoclean cat /etc/debian_version df sudo apt-get --yes install net-tools # Contains ifconfig command. sudo delta setup snmp-server 10.10.1.12 # Install and configure snmp server. sudo delta setup vim # Install and configure vim editor for each user. sudo grep -Ei --color=always "bad |brok|cann|crit|deni|err:|erro|fail|igno|insu|leak|lost|miss|not |such|unab|warn" /var/log/syslog sudo zgrep -i 'systemd-networkd-wait-online' /var/log/syslog* sudo zgrep -i 'lost carrier' /var/log/syslog*
-
Enter the following commands at a Command Line.
sudo delta setup apache sudo delta setup exim sudo delta setup gnupg sudo delta setup jshint sudo delta setup jslint sudo delta setup git sudo delta setup php sudo delta setup postgresql sudo delta setup repository sudo delta setup samba Other$