You start a new instance of a VM using the startvnet
command line in a terminal window like this:
$ /usr/local/vnet/bin/startnet
What will happen then is that a new instance of the VM will be created, the Linux kernel will start up, and then systemd
will start running inside the VM to launch the initial services, such as the SSH server so you can log in.
You'll see all this happening in your terminal window via a [very] long series of status and progress messages from the Linux kernel first, and then from systemd
.
In amongst all the start up messages, towards the end, are two things you should look for:
Initially, the VM starts up in the following state:
/home
, /import
and /tmp_amd
directories are shared from the host computer to give you access to your home and class directories.ls -l
and ps
commands, for example.up
. Being up
is important because without being set to up
(see ip link help
), they cannot send or receive network packets).
You can log in to your VMs either as root or as yourself (using your zID or CSE user name). You do both via ssh
.
ssh
as root to the VM's IP address (see above) from the same VLAB host where you started the VM. Use the root password to authenticate.ssh
using your zID or CSE account name to the VM's IP address (see above) from the same VLAB host where you started the VM. This requires:.ssh/authorized_keys
for your CSE account, ORFirst, save anything you want to keep in your home directory.
shutdown -h now
inside the VM is a good choice and will cause the VM to terminate in a tidy fashion. halt --force
is less good (read: brutal), but will also work. Both of these need to be run as root inside the VM.
The eth1 and eth2 interfaces of every VM (including those started by other users) are each connected to one of two VLANs shared with all other running VMs. When you start a VM of your own, its eth1 and eth2 network interfaces are each configured with an IP address which is unique to that VM on the VLAN and which allows your VM to communicate with all other running VMs and allows other VMs to communicate with yours. For more detail, see networking.
You can determine the IP address of the interfaces by running this command:
# ip addr ls
This will display the addresses of every interface on your VM, including eth1 and eth2.
Note: There's a potential security problem here because if you allow other users to log onto your VM via SSH, or if you set up a web server which runs CGI scripts on your VM, these may or will have access to your CSE home directory as you.
eth3 and eth4 connect all of your own VMs to each other via two private VLANs. When you start up a VM these two interfaces are not configured. They are connected, but not configured and to use them you must assign them IP addresses and enable the interfaces. Details can be found here.