KVM has a large array of command line options that literally take a manual to sift through. Every now and then some minor but useful options get added that’s worth a look. In this post I want to look at two of them available since the 0.11-rc series: specifying boot order and setting your kvm guest process name. Let’s start with the new boot order option.
You can now specify the boot order of your drives using a string of drive letters. The drive letters used are dependent on your target architecture. Let’s take the common case of the x86 pc architeture as an example. On the x86 pc architecture, a and b are used for floppy 1 and 2, c for first hard disk, d for cdrom and n to p for etherboot adapters. By default your kvm guest will try to boot from the first hard disk. But let’s suppose you want to boot first from the network then your first hard disk if that fails. In that case you’ll use the following options when starting your kvm guest.
qemu-kvm –hda linux.img –m 512 -boot,order=nc
You can also specify a particular boot order to happen only on the first startup with the once argument. So if you want to boot from network first then hard disk but return to default after a reboot then you would use the following options:
qemu-kvm –hda linux.img –m 512 -boot,once=nc
Finally you can also enable an interactive boot menu options if your bios/firmware supports it by using the menu option. So if you wanted to use this option, you would start kvm with the following options:
qemu-kvm –hda linux.img –m 512 -boot,once=nc,menu=on
As with some of the other options, these options are upgrades to the old format so the legacy format will be deptrecated sometime in the near future. In other words, start getting used to them if you manage your kvm guests primarily by command line.
Another handy little command line option allows you to specify the name of the kvm process for your guest. How many times have one of your guests begin to hog cpu cycles but you couldn’t tell the difference by running a top? Well this option will help make it easier to differentiate your guest processes by allowing you to name them during startup. So if you wanted to name your windows xp guest process winxp1 for example, you would start your guest with the following command line options:
qemu-kvm -hda windows.img -m 512 –name windowsxp,process=winxp1
This option in particular I think is simple but has real practical value when trying to differentiate your kvm guest processes. Of these two new options this one is my personal favorite and I think GUI tools should integrate both of these options.
Comments
Couch
Thursday, September 10, 2009 - 14:31 Maxim (not verified)Cool, but errr.... any word on the virtio-win package?
Re: Couch
Thursday, September 10, 2009 - 14:39 Haydn SolomonI haven't had any luck on getting the block drivers to work yet hence no follow up post. Still working on it though...
-process
Tuesday, September 22, 2009 - 04:36 Gilou (not verified)Hi ;)
I've always been setting -name XXX as the first parameter as a workaround to be able to sort/monitor the VMs easily, but that is obviously a nice thing.
Hey there, I'm having
Friday, September 3, 2010 - 11:03 Larry (not verified)Hey there,
I'm having problems viewing your site using the Avant browser, for some reason the font is very small (almost unreadable) Any ideas why?
Many thanks
Loz
- hp 6735s
Re: avant browser
Friday, September 3, 2010 - 12:58 Haydn SolomonJust tried it and it's look fine. I only tried it on windows though and from what I can see, it only runs on windows right?
Post new comment