VirtualNET @ CSE - Administration information
- The files used by VirtualNET on each host are located in
/usr/local/vnet
.
- The VM disk images are stored on local disk using Linux's LVM. LVM uses spare space on the local hard disk, typically
/dev/sda2
. Good tools to know are pvdisplay
and lvdisplay
(and, maybe, man lvm
).
- There's a configuration file at
/usr/local/vnet/etc/config
.
update_image
runs rsync
to sync the local master disk image from the master Arch Linux host.
recreate_lvm_volumes
completely rebuilds the LVM volumes (after deleting everything) and runs update_image
to recreate the disk images. The physical disk partition needs to exist.
startvnet
is basically a very simple setuid-root binary which runs the startvnet.sh
shell script. In turn, this runs umllinux
(the UML Linux kernel) as the user to start up the VM.
- When a VM starts, instead of
init
or systemd
, it first runs the shell script /umlsetup/umlsetup
. This does some setup (including configuring addresses for eth0, eth1 and eth2) and then exec's /usr/lib/systemd/systemd
.
- The logical hard disk of each user's VMs on a host are created as thin LVM volumes whose names start with “clone” and which contain the user's UID and the VM index (0 - 3).
- The master Arch Linux machine needs to have the following changes:
Add two lines to /etc/pam.d/system-auth
before all other “account” lines to implement locking out of users other than the one who started the VM:
account [default=ignore success=1] pam_succeed_if.so debug uid = 999999
account required pam_succeed_if.so debug uid = 0