this post was submitted on 06 Apr 2025
30 points (94.1% liked)

Linux

53032 readers
382 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Hello everyone!

I have been learning QEMU for the past day and so I've almost finished building my perfect VM from the qemu cli, and I was wondering if there is any method to say, copy a partition(+bootloader) of a physically installed system (in this case, Windows) over a hard disk image and run it with QEMU

Unfortunately I've had no luck searching online about it and I'm unsure how to proceed myself since I've never done any disk-cloning or anything like that

My best guess would be to dump the contents of the partitions into a shared folder with the VM, then use a live media to copy those contents over into the hard disk image and finally install a bootloader to work with the Windows boot manager, but I'm all ears for what anyone has to say about it.

Thanks for reading and please let me know what you know!

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 8 points 6 days ago (1 children)

I also wanted to put an emphasis on how working with virtual disks is very much the same as real ones. Same well known utilities to copy partitions work perfectly fine. Same cgdisk/parted and dd dance as you otherwise would.

Technically if you install the arch-install-scripts package on your host, you can even install ArchLinux into a VM exactly as if you were in archiso with the comfort of your desktop environment and browser. Straight up pacstrap it directly into the virtual disk.

Even crazier is, NBD (Network Block Device) is generic so it's not even limited to disk images. You can forward a whole ass drive from another computer over WiFi and do what you need on it, even pass it to a VM boot it up.

With enough fuckery you could even wrap the partition in a fake partition table and boot the VM off the actual partition and make it bootable by both the host and the VM at the same time.

[–] [email protected] 2 points 6 days ago

Learning to use QEMU I started to grasp those possibilities actually, now getting these tips I do feel like I could dive into lots of "sandboxing" and generally be able to try anything with it, my only constrain now shall be disk space