Passthrough internal harddrive - Ubuntu

chattingfun

New Member
Oct 20, 2022
13
0
1
Hello,
I am stuck on how to configure ubuntu to access the passthrough drive that is a internal hard drive in my proxmox 7.2-11
I was able to get my windows 10 vm to be able to see the internal hard drive.

Here is the steps I have done so far.
Get the unique identifier of the drive in the shell console on the proxmox
ls -n /dev/disk/by-id/

PassThrough command to the VM
# /sbin/qm set [VM-ID] -virtio2 /dev/disk/by-id/[DISK-ID]
e.g /sbin/gm set 200 -virtio2 /dev/disk/by-id/wwn-0x5000c500e5008516

Create a mount folder
sudo /mnt/data

To remount on reboot edit the /etc/fstab
sudo nano /etc/fstab

Add this line in the fstab
LABEL=Storage /mnt/data ext4 defaults 0 2

In the Windows 10 VM
Hard Disk (virtio2) /dev/disk/by-id/wwn-0x5000c500e5008516

For the Ubuntu VM

ls -n /dev/disk/by-id/
e.g /sbin/gm set 300 -virtio2 /dev/disk/by-id/wwn-0x5000c500e5008516

Hard Disk (virtio2) /dev/disk/by-id/wwn-0x5000c500e5008516

What do I need to get this drive to be seen by the VM?

I took screen shot of the lsblk & blkid command:
 

Attachments

  • blkid command.png
    blkid command.png
    31.7 KB · Views: 4
  • lsblk command.png
    lsblk command.png
    31.7 KB · Views: 4
In the Windows 10 VM
Hard Disk (virtio2) /dev/disk/by-id/wwn-0x5000c500e5008516

For the Ubuntu VM

ls -n /dev/disk/by-id/
e.g /sbin/gm set 300 -virtio2 /dev/disk/by-id/wwn-0x5000c500e5008516
You are passing the same disk to two guest.
This can't work.
You need a cluster filesystem to be able to do that and even then this filesystem will not work across two different OS.

If you want to share data between the two guests either create a dedicated file server or create a share from one guest and mount it on the other.
 
  • Like
Reactions: noel. and Dunuin
You are passing the same disk to two guest.
This can't work.
You need a cluster filesystem to be able to do that and even then this filesystem will not work across two different OS.

If you want to share data between the two guests either create a dedicated file server or create a share from one guest and mount it on the other.
Not necessary true, another way but it has more over head is to setup a True NAS VM and share the hard drive that away.
 
You can pass the disk through to the Ubuntu VM, then install samba on the VM and create shares which you can then map on the Windows VM
 
is there a way that proxmox can share a drive to more than one vm?
This isn't something which is limited py PVE. It is your guest operating system and its capabilities.
Install another VM (or Container) which provides File Shares. Don't waste your time trying to achieve something which will not work!
 

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!