CNT5605 — 2016 Fall
Assignment 5
No journal required.

Assignment: Virtualization with QEMU

Your objectives are to change the networking on your new server from DHCP to static, install QEMU, and then install both Debian and NixOS as virtual servers.

(If you haven't done an "apt-get update && apt-get upgrade", it would be a good idea to do so now before starting on the assignment.)

First, change your networking from DHCP to a static network configuration. Use an IP number derived by adding your roster number to; for instance, if your roster number is 23, your ip would be the gateway is "", the netmask is "", and the broadcast address is "". I recommend using the static method delineated at, but feel free to do something different if you prefer.

If you use the static method from above, it boils down to adding lines like

auto eth0
iface eth0 inet static
to the end of the file /etc/network/interfaces (or creating a new file in /etc/network/interface.d/), and then verifying that "/etc/resolv.conf" has as your DNS server. Please reboot after you make these changes to verify that you everything works. Use the commands 'ifconfig eth0' (or 'ip addr' if you don't have ifconfig installed), 'netstat -rn', and 'cat /etc/resolv.conf' to verify that the results look reasonable:
$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr d4:3d:7e:98:ad:78  
          inet addr:  Bcast:  Mask:
          RX packets:734543 errors:0 dropped:0 overruns:0 frame:0
          TX packets:169551 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:583246892 (583.2 MB)  TX bytes:20797887 (20.7 MB)
$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface         UG        0 0          0 eth0   U         0 0          0 eth0
$ cat /etc/resolv.conf

Next, install QEMU; you can read about using QEMU in Debian at, but the fundamental step is along the lines of

$ apt-get install qemu qemu-kvm qemu-system

Now pull in the Debian testing netinstall ISO:

$ wget

Now do an install of your new virtual server via QEMU in a new subdirectory "qemu-images":

$ mkdir qemu-images
$ cd qemu-images
$ qemu-img create debian0.img 10G
$ qemu-system-x86_64 -hda debian0.img -cdrom debian-testing-amd64-netinst.iso -boot d -m 512 -enable-kvm
And, finally, reboot without the cd image:
$ qemu-system-x86_64 -hda debian0.img -boot d -m 512 -enable-kvm

Next, pull down an ISO of NixOS from here; I would suggest "latest-iso-graphical-x86_64-linux", but "latest-iso-minimal-x86_64-linux" is certainly viable, and is smaller.

Now use your image to install a QEMU server in the same subdirectory:

$ qemu-img create nixos0.img 10G
$ qemu-system-x86_64 -hda nixos0.img -cdrom latest-iso-minimal-x86_64-linux -boot d -m 4096 -enable-kvm

And, finally, after you have installed, then reboot without the cd image:

$ qemu-system-x86_64 -hda nixos0.img -boot d -m 4096 -enable-kvm

You might be amused to visit the "/nix/*" subdirectories.

A journal is not due for this assignment.