Skip to content

Instantly share code, notes, and snippets.

@laineantti
Last active August 17, 2022 12:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save laineantti/325606e178e13272f5ef30a565b55076 to your computer and use it in GitHub Desktop.
Save laineantti/325606e178e13272f5ef30a565b55076 to your computer and use it in GitHub Desktop.
Proxmox - Physical disk to kvm, Source: https://pve.proxmox.com/wiki/Physical_disk_to_kvm
# Install if lshw not found
apt install lshw
# Check disk info
lshw -class disk -class storage
# Do this again for every disk
qm set <disk_id> -virtio<number from 2 to 999, remember that you cannot use 1!> /dev/disk/by-id/<disk_long_id>
# (this prints: update VM <disk_id> -virtio2 /dev/disk/by-id/<disk_long_id>)
# Check if it did work
cat /etc/pve/qemu-server/<disk_id>.conf
# (output is something like this:
# virtio2: /dev/disk/by-id/<disk_long_id>,size=1953514584K
# virtio3: /dev/disk/by-id/<disk_long_id>,size=2930266584K
# virtio4: /dev/disk/by-id/<disk_long_id>,size=2930266584K
# )
# As always when you change the hardware for a KVM guest, do a poweroff and a start (reboot is not enough).
@jLynx
Copy link

jLynx commented Dec 3, 2019

So if I already have windows installed on a physical disk, doing this will let me run it as a VM?

@laineantti
Copy link
Author

So if I already have windows installed on a physical disk, doing this will let me run it as a VM?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment