Does anyone know how to use an existing hard drive as a VM?
What I mean is, hard drive a has Linux on it and hard drive b has Windows 10 on it. Can I bring the existing disk into the Linux vm manager or is that not possible anymore? I’m reasonably sure
- growisofs is going to be an option I’ll need to use on the command line, other that that I’m not sure how to do it. I only boot into Windows to play DiabloIV and if I can do it as a virtual machine so I don’t have to reboot that’d be great.
Thanks in advance for any suggestions or help provided.
Yeah, you can do it, but it’s tricky. With KVM/QEMU you can point the VM straight at the physical disk, like /dev/sdX. VirtualBox can do it too with a raw VMDK mapping.
Couple of warnings though: Windows doesn’t like being booted both natively and as a VM, you’ll hit driver conflicts and probably activation issues. And for Diablo IV, you’d need GPU passthrough or performance will be awful.
For simplicity and best performance, dual boot is still the most reliable.
But Windows takes forever to boot up; I’ve already remove most of what was in the start up menu. I still wind up waiting about 10 minutes before I can do anything. Maybe if I switched over to booting to an SSD instead of a traditional Hard drive it’d be faster booting up but I don’t want to have to re-install Windows to do it. If I could make an ISO and use that to re - install Windows that would be cool. A note on Virtual Box, it’s not in the Debian testing or stable repositories because Oracle has been dragging their feet getting the new dependencies that are needed. It’s only available in Sid and using testing (now Forky) is as brave as I get
@tmick
This is also doable on Vmware, I know it’s not the best OSS solution, but as virtual machine machine manager .. it’s working maybe give a try
@ricky89
I did and I didn’t feel the love that I was supposed to. In VMWare I wasn’t able to run multiple VMs at the same time like I can with qemu/kvm and virtual machine manager which is what I want to be able to do. Yes I’m a whine a butt
@tmick
I honestly have all my VMs on VMware, now it’s license is free for personal use… The most exciting thing I found on VMware is that, after installed the guest addition, you can put a VM fullscreen on dual screen setup, so you can work in a VM such as in a “physical machine” without distractions.
Maybe it’s just a personal taste and habit.
I agree with the recommendations of @hydn.
I do not think you are looking for “growisofs”. The QEMU-KVM related command I think you would want to research is “qemu-img”. I use “qemu-img” regularly to perform maintenance on virtual disks. I use the native QCOW2 format, but “qemu-img” does so much more.
I do not use Windows, I do not game, and I have not had the need to do PCI Passthrough for a GPU or anything else. I cannot offer much help on those topics. I have used USB Redirect for years with external optical drives, and that has been great.
With a Linux installation, I have performed various P2P (Physical To Physical), P2V (Physical To Virtual), and V2P (Virtual To Physical) migrations. To do this, I have used “dd” and “qemu-img”. If the source disk is not encrypted, you can use “sdelete” (within Windows) or the following in Linux to zero the unused sectors to make it easier to compress or shrink with “qemu-img”:
dd if=/dev/zero of=/tmp/zerofile.raw ; rm /tmp/zerofile.raw
Again, I am no longer familiar with the frustrating quirks of Windows, but “dd” can easily be used to migrate about anything else from one disk to another, or from one disk to a file. You may be able to migrate Windows from spinning rust to an SSD by using “dd” from a bootable Linux DVD or USB flash drive. In other words, the source operating system must be ‘shut down’. Also, keep in mind that the destination disk must be the same size or larger than the source disk.
I feel your pain. Switching to a SSD or NVME would definitely decrease your boot time. On an NVME windows boots in about 2 minutes. At the office we clone the HDDs to the SSD or NVME to minimize reinstalling Windows. I don’t know if that would be an option for you.
What are your VM settings? My Win10 VM boots in less than 30 seconds. Disc image is on an SSD.
Sorry I should have been more clear, It takes forever to reboot into the physical hard drive with Windows, not a vm that boots up. It’s just as quick as the other 3 I have (Debian testing, aka Forky, Kali, & CentOS) the vms are fine, just the physical Hard drive (currently a SATA) that takes sooooo loooooooooooooonnnnnnnnnnngggggggg
So if I used something like clonezilla to move my Windows from a HHD to SSD it’s bootable (assuming I remember to change bios to point to that drive). since it’s dual boot would I have to modify my Grub file?
I am not an expert on Grub, but from programming it with Arch, I would say yes, you would have to modify Grub to point to the new drive.
An idea: in my case, in the past I cloned the HDD with Clonezilla and restored it to a virtual disk in raw format (like .img). Then I could boot a SO with virt-manager adjusting the settings of the domain (VM definition). You can also learn a bit about the qemu-img utility. If I were you I wouldn’t use the physical disk at all.
Welcome to our humble site @bricklayerx. So I like the idea of not booting into the Windows drive at all, but it should be bootable in case I manage to screw up my Linux install. If I were to clone it via Clonezilla, it just limits the .img file to the size of the drive, correct? The only place I have to store it is on a external drive, which I don’t want the entire thing overwritten if I could avoid it.
Qemu-img makes it possible to resize and copy files on the virtual cloned drive, avoiding the slowness and risk of using a physical drive. You might consider using auxiliary tools like Parted…
Here’s an update on what I decided to do. I finally got another SSD drive so now I have one for Debian and one for Windows (hopefully it’ll solve the problem of being able to cook and eat a meal waiting for it to finish loading). I used the 500GB for Debian and I will use the 1000GB for windows. If all goes as planned Debian will have the 3TB for Virtual Machines and the 250GB for Windows.
I’m doing a fresh install of both Windows &Debian. Let’s see how this pans out.