Gentoo Archives: gentoo-user

From: Grant Taylor <gtaylor@×××××××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] QEMU on a partition
Date: Fri, 02 Mar 2018 23:52:06
Message-Id: 2ccb9844-0f8d-8458-0d6d-f76fe4a2a46d@spamtrap.tnetconsulting.net
In Reply to: Re: [gentoo-user] QEMU on a partition by R0b0t1
1 On 03/02/2018 08:33 AM, R0b0t1 wrote:
2 > You can pass a block device directly to QEMU, and this is recommended
3 > for performance reasons. I have a Windows 10 VM that was passed an
4 > entire SSD; it runs fine, and you can take the disk and plug it into
5 > other computers. Passing a partition is a little different, if you wish
6 > to load it directly, you would need to chainload it with GRUB, as the
7 > MBR/GPT information would be duplicated.
8
9 Agreed on all accounts.
10
11 > All OP needs to do is pass something like "-drive
12 > file=/dev/block,if=virtio". There should be more options, such as AIO
13 > implementation, but you likely won't need to mess with them.
14
15 > If you pass a block device the MBR/GPT information will be stored
16 > there. In the case of passing a partition, this means you can't boot it
17 > "directly" because the BIOS/EFI firmware can't read it.
18
19 I think that it might be possible to pass the partitions (FS & swap) as
20 individual drives to the guest VM. Make sure that the guest VM mounts
21 them by the UUID and not by path as the path in the VM and bare metal
22 will be different.
23
24 I've not tried this, but I think that it will work. Guest would "mkfs
25 /dev/sda" and "mkswap /dev/sdb"
26
27
28
29 --
30 Grant. . . .
31 unix || die