1 | |
---|
2 | |
---|
3 | ----------------------- |
---|
4 | |
---|
5 | 1. Desktop Virtualization |
---|
6 | |
---|
7 | -- Install VirtualBox on your Desktop |
---|
8 | |
---|
9 | NOTE: This is Optional. We don't want you to install anything |
---|
10 | on your machine if you feel that it will damage your machine or |
---|
11 | that it is not useful. |
---|
12 | |
---|
13 | -- Download and ISO file to use to install an OS. |
---|
14 | |
---|
15 | If you have your own .ISO, you can use that. |
---|
16 | If not, here are two you might copy from the NOC machine: |
---|
17 | |
---|
18 | Puppy Linux: |
---|
19 | http://noc.ws.nsrc.org/downloads/slacko-5.3-MAIN.iso |
---|
20 | |
---|
21 | Ubuntu Desktop: |
---|
22 | http://noc.ws.nsrc.org/downloads/ubuntu-10.04.3-desktop-i386.iso |
---|
23 | |
---|
24 | -- Once you have the OS running, see if you can Install the "Extension Pack" |
---|
25 | |
---|
26 | Usually this will be mounted within the Guest as a |
---|
27 | temporary virtual CDROM mount. |
---|
28 | |
---|
29 | Add the extension pack in the Host. |
---|
30 | Then return to the Guest and see if you can |
---|
31 | mount the extension pack inside the Guest. |
---|
32 | |
---|
33 | |
---|
34 | ------------------ |
---|
35 | |
---|
36 | 2. VNC Remote Displays for Console |
---|
37 | |
---|
38 | For our next exercises, we need a VNC viewer. |
---|
39 | VNC is a Remote Desktop protocol that normally operates |
---|
40 | over port 5900. For our exercises, we will use port numbers |
---|
41 | for each user, such as: user1 -> 5901, user2-> 5902, 5903... |
---|
42 | |
---|
43 | -- Install ChickenoftheVNC or other vncviewer client on your laptop |
---|
44 | |
---|
45 | |
---|
46 | ------------------ |
---|
47 | |
---|
48 | 3. Server Virtualization s3.ws.nsrc.org |
---|
49 | |
---|
50 | -- User1 should Login to "s3" using "sysadmX" |
---|
51 | |
---|
52 | % ssh s3 -l sysadm1 |
---|
53 | |
---|
54 | -- Create A VM Disk using "qemu-img" |
---|
55 | |
---|
56 | % qemu-img create -f qcow2 adm1img.qcow2 6G |
---|
57 | |
---|
58 | -- Boot Up a VM using that disk image using qemu |
---|
59 | and one of the ISO files in /ISOS. |
---|
60 | Please use Username: "sysadm", and the password we have been using |
---|
61 | for the Username that you create. |
---|
62 | Please Skip the "updates" to save some time. |
---|
63 | |
---|
64 | a) Use "vnc :#" when starting the qemu, and connect using VNC to "s3:(5900+#)" |
---|
65 | |
---|
66 | ex. For sysadm1, use: vnc :1 implies host and port will be: s3:5901 |
---|
67 | When you connect with ChickOfTheVNC, you will connect to s3:5901 |
---|
68 | ex. For sysadm2, use: vnc :2 ... s3:5902 |
---|
69 | ex. For sysadm3, the command might be: |
---|
70 | |
---|
71 | % qemu -hda adm3img.qcow2 -cdrom /ISOS/ubuntu-10.04.3-desktop-i386.iso -vnc :3 |
---|
72 | |
---|
73 | b) Install an Operating System to the first virtual drive. |
---|
74 | |
---|
75 | (NOTE: if you don't want to wait for an install, just copy the virtual hard disk |
---|
76 | image in from the ISOS directory: |
---|
77 | |
---|
78 | % cd; |
---|
79 | % cp /ISOS/ubuntudeskimg.qcow2 sysadmimg |
---|
80 | |
---|
81 | Then you can start qemu as before, but you can leave the -cdrom ISO option off. |
---|
82 | You will still need the vnc console. |
---|
83 | |
---|
84 | c) shutdown that Image |
---|
85 | |
---|
86 | Within the VNC guest: |
---|
87 | % sudo shutdown -h -y now |
---|
88 | |
---|
89 | ******************************************************* |
---|
90 | *** PLease make sure you are inside your GUEST VM, *** |
---|
91 | *** NOT on an s3: prompt when you do this!!! *** |
---|
92 | ******************************************************* |
---|
93 | |
---|
94 | ------------------ |
---|
95 | |
---|
96 | 4. Snapshots |
---|
97 | |
---|
98 | Create a "Snapshot" Image using "qemu-img" |
---|
99 | with the original image as the basefile. |
---|
100 | |
---|
101 | qemu-img can create a "snapshot" that refers back to a basefile. |
---|
102 | Use your new image as the basefile. After this, you will start qemu |
---|
103 | using only the new snapshot file. The basefile will remain read-only |
---|
104 | and will not change. All writes will go to the new file. |
---|
105 | |
---|
106 | % qemu-img create -b adm3img.qcow2 -f qcow2 newadm3.qcow2 |
---|
107 | |
---|
108 | Notice how small the new file is at this point: |
---|
109 | |
---|
110 | % ls -lo newadm3.qcow2 |
---|
111 | |
---|
112 | Now start the emulator with the new image: |
---|
113 | |
---|
114 | % qemu -hda newadm3.qcow2 -vnc :3 |
---|
115 | |
---|
116 | |
---|
117 | ------------------ |
---|
118 | |
---|
119 | 5. The Qemu Montiro |
---|
120 | |
---|
121 | -- Interrupt the Image Using the QEMU-KVM Monitor |
---|
122 | CTRL-ALT(OPT)-2 and CTRL-ALT(OPT)-1 |
---|
123 | Try the following commands: |
---|
124 | > stop |
---|
125 | > cont |
---|
126 | > info block |
---|
127 | |
---|
128 | You can attach and detach CDROM drives and USB drives |
---|
129 | and change vnc settings, and many other things within |
---|
130 | the monitor console. Typically, the monitor is used |
---|
131 | for system operations such as "system_powerdown", or |
---|
132 | "stop" or "cont", or for saving snapshots or for performing |
---|
133 | migrations. |
---|
134 | |
---|
135 | -- Try system_powerdown |
---|
136 | |
---|
137 | Issue the command inside the monitor. |
---|
138 | |
---|
139 | Switch back to the Guest VM using the CTRL command. |
---|
140 | |
---|
141 | Was the monitor able to powerdown the Guest VM? |
---|
142 | |
---|
143 | ------------------ |
---|
144 | |
---|
145 | 6. Optional: virt-manager |
---|
146 | |
---|
147 | Use the "qemu:///session" option so that each user has their |
---|
148 | own session directory. |
---|
149 | |
---|
150 | Remember this is a GUI, so I will use X on my desktop to view |
---|
151 | the GUI. |
---|
152 | |
---|
153 | From your own laptop: |
---|
154 | % ssh -X s3 -l sysadmXX |
---|
155 | |
---|
156 | On the s3 virtual server: |
---|
157 | % virt-manager -c qemu:///session |
---|
158 | |
---|
159 | See if you can do an install using the GUI interface. |
---|
160 | |
---|
161 | After you finish, check with "virsh": |
---|
162 | |
---|
163 | % virsh -c qemu:///session |
---|
164 | > virsh # list --all |
---|
165 | |
---|
166 | --- |
---|