开发者

in qemu/kvm, can I mount a host partition as a virtual disk drive?

开发者 https://www.devze.com 2023-04-12 14:05 出处:网络
I have a new laptop with a Windows partition and a Linux partition.I want to run qemu/kvm under Linux, and run an instance of Windows XP on that virtual machine.The desired setup is to have a virtual

I have a new laptop with a Windows partition and a Linux partition. I want to run qemu/kvm under Linux, and run an instance of Windows XP on that virtual machine. The desired setup is to have a virtual disk (in a Linux host file) as the C: drive on the virtual machine, and the underlying host Windows partition as the D: drive on the virtual mac开发者_StackOverflowhine. This is the setup I have been using for a while under VirtualBox on another laptop. Is it possible to do this with qemu/kvm?

One note - I don't have the Windows partition mounted under Linux, so the virtual machine instance would have the Windows partition all to itself. I would prefer the Windows partition to be read/write, but that is not absolutely necessary.

Thanks in advance,

Greg Johnson


I am pretty sure what you want to do can be done. You would need to ...

  1. Create a file for the master boot record to be used by qemu/kvm
  2. Mount it as a loop device
  3. Prepend it to your Windows partition using software RAID

Then start QEMU using the RAID device as "-hdc" for drive C: or "-hdd" for drive D:. The drive would be read-write.

You can find detailed instructions at the Arch Linux QEMU wiki page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号