Crash course: Virtualization with KVM on Ubuntu Server

Learn how to get KVM running on Ubuntu Server, install multiple guests, manage storage, and migrate guests to new hosts

Page 3 of 4

Installing guests

There's not much going on yet because we haven't installed any guests. You can install new guest operating systems from CD/DVD, ISO images, netinstalls, and PXE boot. CD/DVD installations need an internal drive; USB drives don't work. Installations from ISO images are my favorite because they are fast, and you don't have to burn a disk. For network installations you'll need the URL of your installation server, and for PXE boot a TFTP/PXE boot server.

To install a new guest click the "Create a new virtual machine" button, and follow the screens. (To find an ISO image anywhere on your system, click the Browse button in screen 2, and then look at the bottom left of the "Locate ISO media volume" screen for the Browse Local button. Click this to open a filepicker.) On screen 5 be sure to check "Allocate entire disk now." This doesn't mean it will take over your whole disk, but will reserve all the space you allocated for the guest at once. If you don't select this, then KVM will allocate space as needed, up to the maximum allotted. Disk space is cheap these days, so it's not worth running the risk of data corruption from accidentally running out of room. Reserve the guest's full allotment from the start, and then you won't have to think about it anymore.

The VM window may not be large enough to show the whole screen of your guest, so grab a corner with the cursor to drag it to fit. If the VM captures your mouse pointer press Ctrl+Alt to get it back. Figure 2 shows a normal OpenSUSE installation from an ISO image.

Figure 2: Installing an OpenSUSE guest

Figure 3 below shows what three guest operating systems look like, all running at the same time and their consoles open, with the Virtual Machine manager on top.

Figure 3: Three guest operating systems-- Jeoss, Ubuntu Server, and OpenSUSE, all running on the KVM server

You can control each guest just as though they were installed on separate machines, and start them up and shut them down as you like. Networking is enabled automatically, so your guests can access the Internet and your LAN. Each guest can be modified after installation by opening the guest's console, and then clicking on the blue information button (Figure 4). On this screen you can fine-tune CPU use, memory, view performance graphs, control boot options, setup peripherals, manage storage, and add new hardware devices. By default CD/DVD drives and USB storage devices are not accessible by the guests, so these have to be added manually.

Figure 4: Editing the guest after installation. Everything is modifiable
| 1 2 3 4 Page 3
ITWorld DealPost: The best in tech deals and discounts.
Shop Tech Products at Amazon