KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

Some new kvm options: boot order and process name

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.

 

Specifying Boot Order with KVM

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.

 

New kvm option to set your process name

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.
 

See Also

Comments

Couch

Cool, but errr.... any word on the virtio-win package?

Re: Couch

I haven't had any luck on getting the block drivers to work yet hence no follow up post. Still working on it though...

-process

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

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

Just 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

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.