<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linux-kvm.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bkw</id>
	<title>KVM - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://linux-kvm.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bkw"/>
	<link rel="alternate" type="text/html" href="https://linux-kvm.org/page/Special:Contributions/Bkw"/>
	<updated>2026-04-22T04:20:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://linux-kvm.org/index.php?title=Boot_from_virtio_block_device&amp;diff=2942</id>
		<title>Boot from virtio block device</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=Boot_from_virtio_block_device&amp;diff=2942"/>
		<updated>2010-04-04T20:24:19Z</updated>

		<summary type="html">&lt;p&gt;Bkw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
Virtio block device is a para-virtualized device for kvm guest. It is different from normal emulated hard drive, because it is simply faster. This small how-to is about how to make a disk para-virtualized and boot from it.&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
== Steps ==&lt;br /&gt;
&lt;br /&gt;
# create a disk and install os to it by appending &amp;quot;-hda &amp;lt;your_disk_image&amp;gt;&amp;quot; to your virtual machine&lt;br /&gt;
# in your guest os, upgrade kernel to 2.6.25 which contains virtio_* drivers. or ubuntu 8.04 also has it.&lt;br /&gt;
# in guest os, change /boot/grub/device.map from &amp;quot;(hd0) /dev/sda&amp;quot; to &amp;quot;(hd0) /dev/vda&amp;quot;&lt;br /&gt;
# in guest os, change /boot/grub/menu.list from &amp;quot;root=/dev/sda1&amp;quot; to &amp;quot;root=/dev/vda1&amp;quot;, if you are using UUID, then no need to do this step.&lt;br /&gt;
# enable para-virtualization by changing &amp;quot;-hda &amp;lt;your_disk_image&amp;quot; to &amp;quot;-drive file=&amp;lt;your_disk_image&amp;gt;,if=virtio,boot=on&amp;quot;&lt;br /&gt;
&lt;br /&gt;
note: current debian lenny default kernel (2.6.26-2-amd64) will &#039;&#039;&#039;not&#039;&#039;&#039; give any output when running &amp;quot;dmesg | grep virtio&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Error 18 ==&lt;br /&gt;
&lt;br /&gt;
you may experience this error while grub is booting. I solved it by making the /boot the first partition and make it 32MB.&lt;br /&gt;
&lt;br /&gt;
== qcow2 ==&lt;br /&gt;
&lt;br /&gt;
I have problem to boot from qcow2 format image, it will hang while kernel booting. you may convert your disk image to raw format by &amp;quot;qemu-img convert -f qcow2 &amp;lt;your_disk_image&amp;gt; -O raw &amp;lt;a_new_location&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Booting with lilo ==&lt;br /&gt;
&lt;br /&gt;
You must add this to your lilo.conf:&lt;br /&gt;
&lt;br /&gt;
 boot=/dev/vda&lt;br /&gt;
 disk=/dev/vda bios=0x80 max-partitions=7&lt;br /&gt;
&lt;br /&gt;
and after your image clausule change:&lt;br /&gt;
 &lt;br /&gt;
 root=/dev/vda1&lt;br /&gt;
&lt;br /&gt;
where vda1 is your boot partition&lt;br /&gt;
&lt;br /&gt;
== Updating the guest initramfs with the virtio driver ==&lt;br /&gt;
If you are hosting a debian guest then you may want to update its initramfs with the virtio driver as explained in [[Using VirtIO NIC]]&lt;br /&gt;
&lt;br /&gt;
= Windows XP =&lt;br /&gt;
Windows driver installation is a bit tricky.&lt;br /&gt;
* In your guest, download the [[WindowsGuestDrivers/Download_Drivers|Windows driver]]&lt;br /&gt;
* Stop the machine and create a new image that you will add as a second disk&lt;br /&gt;
 kvm-img create -f qcow2 fake.qcow2 1G&lt;br /&gt;
&lt;br /&gt;
* Start the machine. You will be prompted to install the driver. This is enough to allow to boot on the &#039;&#039;virtio&#039;&#039; disk&lt;br /&gt;
 kvm -drive file=windows.qcow2,if=ide,boot=on -drive file=fake.qcow2,if=&#039;&#039;&#039;virtio&#039;&#039;&#039; ...&lt;br /&gt;
&lt;br /&gt;
* Restart the machine, but with the &#039;&#039;virtio&#039;&#039; driver on the first disk&lt;br /&gt;
 kvm -drive file=windows.qcow2,if=&#039;&#039;&#039;virtio&#039;&#039;&#039;,boot=on&lt;br /&gt;
&lt;br /&gt;
* You will be prompted once again to install the driver.&lt;/div&gt;</summary>
		<author><name>Bkw</name></author>
	</entry>
</feed>