mountdrivetovirtual
FOR VIRTUAL MACHINE
- In Proxmox terminal:
ls -l /dev/disk/by-id/ qm set abc -scsi1 /dev/disk/by-id/xxxxxxx ** where abc is the virtual machine ** where xxxxxx is the drive ID
- Under Ubuntu, mount drive:
lsblk <-- to list down the available drives mkdir /mnt/newdrive <-- to create a folder that will be mounted on sudo mount /dev/sdx /mnt/newdrive/
- to mount automatically on boot after first mount
sudo blkid /dev/sdx1 <-- get the UUID of the new drive
sudo nano /etc/fstab <-- edit the fstab and add line below
UUID=YOUR_UUID_HERE /mnt/newdrive ntfs3 defaults,uid=1000,gid=1000,nofail 0 0
sudo umount /mnt/win_share
sudo mount -a
*Note: uid=1000 and gid=1000 ensure your main Ubuntu user owns the files so you don't run into permission issues. nofail ensures that if you ever pull the physical drive out, the VM will still boot up normally.
FOR LXC MACHINE
- In Proxmox terminal:
mkdir -p /mnt/host_ntfs mount -t ntfs3 /dev/sdx1 /mnt/host_ntfs pct set xxx -mp0 /mnt/host_ntfs,mp=/mnt/container_ntfs
mountdrivetovirtual.txt · Last modified: by jwan
