Internal used SSD to share to VMs?

Fabien44

New Member
Sep 3, 2023
8
0
1
Hello

I am a newbee and move from Windows to Proxmox.
My machine has 2 internal SSD, one for OS, one for media files (NTFS).

After installing Proxmox i can see the disks but only 2 storages for system i Guess.

I would like to create 2 VM, one for Plex, one for Home Assistant.
I need these VM to access in Reading/writing mode to the media disk.

How to proceed properly for quicker access as possible ?
Should i create a storage to the host and add it as hardware to each VM, or samba share or mount system files, ...?

Thanks for your help.
 
Last edited:
Hello
I have moved from Windows 11 running H24 as a server.

I have 250GB nvme for OS. I dedicated for my 2VMs 50GB each, large enough.
I have still space for other future VMs.

My need is simple: how to make reachable my sata SSD drive for the VMs?

I want that my Plex VM could read movies, store movies to this disk.
As well, i want HA VM to read and write pictures saved in this disk.

I would like also to access this disk from my portable PC windows to manage files.

Thanks again for your support.
 
Ok No problem.
Go to the Host Panel and them Disks. You will se the distribution of you disk.
I have 2 diks in mirroring RAID. I set up a portion for OS and stuffs. Another portion for the vms .
In this case i use LVM.
1693767496791.png
 
I want that my Plex VM could read movies, store movies to this disk.
As well, i want HA VM to read and write pictures saved in this disk.

I would like also to access this disk from my portable PC windows to manage files.
My guess would be that you want to do as less in CLI as possbile? As PVE doesn't come with any NAS functionalities, I would then create a third VM like a OpenMediaVault, disk passthrough the non-system disk into the NAS VM, create your SMB shares and mount the SMB shares in your HA and Plex VMs.
Or you skip PVE entirely and use a NAS OS that also supports running VMs, like a TrueNAS Scale or Unraid, if you primarily care about a NAS or if everything should work out of the box or at least with everything doable via webUI.
 
Last edited:
Ok No problem.
Go to the Host Panel and them Disks. You will se the distribution of you disk.
I have 2 diks in mirroring RAID. I set up a portion for OS and stuffs. Another portion for the vms .
In this case i use LVM.
View attachment 54977
Thanks you but what next?
I see the SATA disk in host panel, how to see it in the VMs? I don't want to format it because i have data on it.
 
My guess would be that you want to do as less in CLI as possbile? As PVE doesn't come with any NAS functionalities, I would then create a third VM like a OpenMediaVault, disk passthrough the non-system disk into the NAS VM, create your SMB shares and mount the SMB shares in your HA and Plex VMs.
Or you skip PVE entirely and use a NAS OS that also supports running VMs, like a TrueNAS Scale or Unraid, if you primarily care about a NAS or if everything should work out of the box or at least with everything doable via webUI.
Thanks.
I have to create a VM to set up Samba?

If i create storage for non system disk and add it as hardware in the config off VMs, what's the concern?
 
Thanks.
I have to create a VM to set up Samba?
You could install and setup a samba server yourself directly on the PVE host. But this then all would have to be done in CLI. So you should know what you are doing.
If i create storage for non system disk and add it as hardware in the config off VMs, what's the concern?
You can't access a filesystem from your host inside your VM without something like virtfs which isn't that well supported yet. VMs only work with block devices, so without SMB/NFS your plex, HA and other hosts won'T be able to access the same files. If you want to access the same files from different VMs or hosts, you need a SMB server running and PVE doesn't come with one as it is no NAS.
 
Last edited:
  • Like
Reactions: Fabien44
Thanks for explanation,i begin to understand.
So VM is very isolated from the host and heavier ressource demanding i read.
If i plan to switch Plex in a container, it would be a better approach to lighter solution and easier access to host filesystem ? What are the cons?
 
Thanks for explanation,i begin to understand.
So VM is very isolated from the host and heavier ressource demanding i read.
Yes, VMs are fully isolated which is great for security, less dependencies, less troubles but got more overhead and they can't make any direct use of the physical hardware without using PCI passthrough.
If i plan to switch Plex in a container, it would be a better approach to lighter solution and easier access to host filesystem ? What are the cons?
Less secure, more dependencies, often harder to set up as LXCs and the PVE host share the kernel so a LXC is often running into permission problems. Some of those downsides for example is that a unprivileged LXC can't directly mount any SMB shares because of missing privileges. Harder to migrate between PVE nodes, slower backups to PBS.
 
Last edited:
  • Like
Reactions: Fabien44
In fact i don't care about security, it's only a home use.
With container i can use direct access to filesystem through bind mount, isn't it? Then i could bypass the network/samba layer, so more efficient.
For my usecase, container would be more suitable, eaysier and faster than VM.

For windows pc access to the disk, i guess i can install samba inside the host without VM!?
 
In fact i don't care about security, it's only a home use.
Bots don't care if your services are at home or in a proper datacenter. As soon as you open your firewall and do a port forward so you can access your plex or HA from your smartphone/Laptop you should care about security.

With container i can use direct access to filesystem through bind mount, isn't it?
Yes.
Then i could bypass the network/samba layer, so more efficient.
Yes, but you also wrote you want to access your data from your portable windows PC where only SMB/NFS would help.

For windows pc access to the disk, i guess i can install samba inside the host without VM!?
Yes, but don't expect that to be easy.
 
  • Like
Reactions: Fabien44
Hello

thanks for your help. I really well progessed.

Now, i have
- one VM for Home Assistant
- one container for Plex (id=100)
- one container for Roon server (id=101)

I changed my plan for security issue. I don't open ports for Plex and Roon (i don't use them away from home), just port forwarding for Home Assistant.

Now, i face a issue with sharing my media disk.
Indeed, i can mount point to one container but not for the second (it refused to start).

What i did in shell host:

pct set 100 -mp0 /dev/sda1,mp=/mediatheque,shared=1
pct set 101 -mp0 /dev/sda1,mp=/mediatheque,shared=1

I can start CT 100 but not CT101, and vice versa. My CT are privileged.
So i cannot share same disk to several containers? What's wrong with my parameters?

Thanks

logs:
DEBUG conf - ../src/lxc/conf.c:run_buffer:311 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 100 lxc pre-start produced output: mount: /var/lib/lxc/.pve-staged-mounts/mp1: /dev/sda1 already mounted or mount point busy.
dmesg(1) may have more information after failed mount system call.
DEBUG conf - ../src/lxc/conf.c:run_buffer:311 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 100 lxc pre-start produced output: command 'mount /dev/sda1 /var/lib/lxc/.pve-staged-mounts/mp1' failed: exit code 32
ERROR conf - ../src/lxc/conf.c:run_buffer:322 - Script exited with status 32
ERROR start - ../src/lxc/start.c:lxc_init:844 - Failed to run lxc.hook.pre-start for container "100"
ERROR start - ../src/lxc/start.c:__lxc_start:2027 - Failed to initialize container "100"
INFO conf - ../src/lxc/conf.c:run_script_argv:338 - Executing script "/usr/share/lxc/hooks/lxc-pve-poststop-hook" for container "100", config section "lxc"
startup for container '100' failed
 

Attachments

  • Capture d'écran 2023-09-04 162341.png
    Capture d'écran 2023-09-04 162341.png
    76.4 KB · Views: 6
Last edited:
I'm no LXC expert, but to me this looks like you are bind-mounting a block device and not a folder of a mounted filesystem.
Mounting a block device twice corrupts the data on it. So maybe PVE won't allow you to start the second container to prevent you from user errors causing data loss?

I would mount sda1 on the PVE host by using its UUID in the fstab and then bind-mount the mountpoint into the LXCs.
 
Last edited:
I finally succeed :)
I mounted the ntfs disk in host fstab file with write permissions for all users, then i created a directory that i could mount to my 2 containers.
Everything works flawlessly.

Cherry on the cake, i don't need samba anymore, i can use SFTP host and manage my media files on Windows (FileZilla).

Thanks for your support again, it helps me a lot.
 

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!