Is it possible to passthrough a physical disk with an OS installed and use it in a VM guest?

hoppel118

Well-Known Member
Apr 5, 2012
57
1
48
Hi,

Debian OS (Stretch) is installed bare metal on the SSD of my server. There are also a lot of Docker Containers configured. My home automation software (FHEM) is installed to the bare metal Debian OS directly. Its not that easy to migrate this to a VM, because I have a lot of FHEM modules in use which were installed by different methods (apt, curl, nodejs/npm, git clone, whatever).

Now I want to clean up my setup. As a temporary solution I want to do the following:

Is it possible to passthrough the SSD with the Debian OS to a VM guest and start this OS within the VM guest instead of a new OS on a virtualised hard disk?

If not, what are my alternatives? Is it possible to "clone" that SSD to an image file (raw/qcow2/img/whatever) and use this instead?

Are there any howtos or documentations to do this?

Thanks Hoppel
 
Thank you. I already knew the two links. But unfortunately I didn't really get any further with them.

I found the following post on reddit:

https://www.reddit.com/r/Proxmox/comments/l9ksze/boot_and_run_a_vm_from_a_physical_disk_taken_from/

So my procedure maybe as follows:
  1. Setup Proxmox on a new disk
  2. Configure a KVM guest
  3. qm set <VM-ID> -sata0 /dev/disk/by-id/<my-transplanted-ssd-id>
  4. make that sata0 the boot device
  5. detach&delete the scsi1 created when creating the VM
Maybe my SSD is not sata0.

What do you think about it?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!