----------------------- 1. Desktop Virtualization -- Install VirtualBox on your Desktop NOTE: This is Optional. We don't want you to install anything on your machine if you feel that it will damage your machine or that it is not useful. -- Download and ISO file to use to install an OS. If you have your own .ISO, you can use that. If not, here are two you might copy from the NOC machine: Puppy Linux: http://noc.ws.nsrc.org/downloads/slacko-5.3-MAIN.iso Ubuntu Desktop: http://noc.ws.nsrc.org/downloads/ubuntu-10.04.3-desktop-i386.iso -- Once you have the OS running, see if you can Install the "Extension Pack" Usually this will be mounted within the Guest as a temporary virtual CDROM mount. Add the extension pack in the Host. Then return to the Guest and see if you can mount the extension pack inside the Guest. ------------------ 2. VNC Remote Displays for Console For our next exercises, we need a VNC viewer. VNC is a Remote Desktop protocol that normally operates over port 5900. For our exercises, we will use port numbers for each user, such as: user1 -> 5901, user2-> 5902, 5903... -- Install ChickenoftheVNC or other vncviewer client on your laptop ------------------ 3. Server Virtualization s3.ws.nsrc.org -- User1 should Login to "s3" using "sysadmX" % ssh s3 -l sysadm1 -- Create A VM Disk using "qemu-img" % qemu-img create -f qcow2 adm1img.qcow2 6G -- Boot Up a VM using that disk image using qemu and one of the ISO files in /ISOS. Please use Username: "sysadm", and the password we have been using for the Username that you create. Please Skip the "updates" to save some time. a) Use "vnc :#" when starting the qemu, and connect using VNC to "s3:(5900+#)" ex. For sysadm1, use: vnc :1 implies host and port will be: s3:5901 When you connect with ChickOfTheVNC, you will connect to s3:5901 ex. For sysadm2, use: vnc :2 ... s3:5902 ex. For sysadm3, the command might be: % qemu -hda adm3img.qcow2 -cdrom /ISOS/ubuntu-10.04.3-desktop-i386.iso -vnc :3 b) Install an Operating System to the first virtual drive. (NOTE: if you don't want to wait for an install, just copy the virtual hard disk image in from the ISOS directory: % cd; % cp /ISOS/ubuntudeskimg.qcow2 sysadmimg Then you can start qemu as before, but you can leave the -cdrom ISO option off. You will still need the vnc console. c) shutdown that Image Within the VNC guest: % sudo shutdown -h -y now ******************************************************* *** PLease make sure you are inside your GUEST VM, *** *** NOT on an s3: prompt when you do this!!! *** ******************************************************* ------------------ 4. Snapshots Create a "Snapshot" Image using "qemu-img" with the original image as the basefile. qemu-img can create a "snapshot" that refers back to a basefile. Use your new image as the basefile. After this, you will start qemu using only the new snapshot file. The basefile will remain read-only and will not change. All writes will go to the new file. % qemu-img create -b adm3img.qcow2 -f qcow2 newadm3.qcow2 Notice how small the new file is at this point: % ls -lo newadm3.qcow2 Now start the emulator with the new image: % qemu -hda newadm3.qcow2 -vnc :3 ------------------ 5. The Qemu Montiro -- Interrupt the Image Using the QEMU-KVM Monitor CTRL-ALT(OPT)-2 and CTRL-ALT(OPT)-1 Try the following commands: > stop > cont > info block You can attach and detach CDROM drives and USB drives and change vnc settings, and many other things within the monitor console. Typically, the monitor is used for system operations such as "system_powerdown", or "stop" or "cont", or for saving snapshots or for performing migrations. -- Try system_powerdown Issue the command inside the monitor. Switch back to the Guest VM using the CTRL command. Was the monitor able to powerdown the Guest VM? ------------------ 6. Optional: virt-manager Use the "qemu:///session" option so that each user has their own session directory. Remember this is a GUI, so I will use X on my desktop to view the GUI. From your own laptop: % ssh -X s3 -l sysadmXX On the s3 virtual server: % virt-manager -c qemu:///session See if you can do an install using the GUI interface. After you finish, check with "virsh": % virsh -c qemu:///session > virsh # list --all ---