u/Chedda_Spren

Big thanks to all the educational content u/TechHutTV makes! I followed his media server guide to setup my original homelab, and after much tinkering, adding new hardware, modifying network configurations.....I ran into the issue where VMs with /etc/fstab automounts to smb shares would fail to boot due to cifs-utils errors. I found two methods to help make the smb share system more resilient:

Solution #1: Add "_netdev" and "nofail" parameters to /etc/fstab file.-"_netdev" : tells the entry to attempt mount after the network is online-"x-systemd.automount": tells systemd to automount (after detecting the network is online)-"nofail": tells systemd to continue to boot even if the mount cannot be mounted

***if anybody has suggestions for further improvements, please comment. I am considering additional parameters like "soft" ,etc but this seems to be working.

Example:

#Remote Shares

//172.x.x.x/data mnt/data cifs _netdev,x-systemd.automount,nofail,credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0

**it appears to be critical to use the server IP address and not the server hostname for this to work

Solution #2: Configure an internal linux bridge without a gateway inside of proxmox and mount smb share folder between VM and lxcs using the internal bridge. This gateway does not have internet access and does not rely on the network router for anything. Removing router-level dependencies helps avoid tinker-induced problems. (Less for you to break!)

Setting up linux bridges in Proxmox is easy, especially for lxcs.

Step 1: Create Linux Bridge. Click on node -> Network -> Create: Linux Bridge. Leave all settings empty. Leave Autostart checked.

https://preview.redd.it/ham2njb5udzg1.png?width=1184&format=png&auto=webp&s=7485b6df63ae68df133105b69bcc29f104906bd6

Step 2: Adding lxcs to the bridge is easy. Click on lxc -> Network -> Add: Network. Give the new network a name, choose the new bridge from the drop down menu, and input a unique IPv4/CIDR address, making sure that it doesn't interfere with other network-level IPs. I just used a totally different subnet range.

https://preview.redd.it/6jual0b7udzg1.png?width=1501&format=png&auto=webp&s=7eb6816fdf0196982f32a30fba5b7b8ec216880a

****Adding VMs is a little trickier. In addition to the Proxmox settings, you may also need to configure static IP and/or DNS settings in the VM OS, and the exact method of doing this may vary depending on what is inside your VM. In my example, I am using a Debian 13 VM.

Step 3: Add Network Device to VM. Click on VM -> Hardware ->Add -> Network Device. All you do here is choose the new bridge from the drop down menu. The rest of the configuration has to be done inside your VM OS.

https://preview.redd.it/xt6pnm59udzg1.png?width=1339&format=png&auto=webp&s=afabb9a477bf420e0a79ddea76c89f13df320def

Step 4: configure VM network interfaces (only validated for Debian 13).

-ssh into the VM.

-command "ip a" to view network devices. Make a note of the interface names for your default network and the newly added bridge.

Set static IP on the newly added bridge interface by modifying "sudo nano /etc/network/interfaces." Do not set a gateway. In my example, I also have a static IP set for my default network.

https://preview.redd.it/tt4hkl4budzg1.png?width=669&format=png&auto=webp&s=4f3f47b5afe264934e3fc5c53737b4744366e51f

Step 5: You can use the linux bridge IP address of the VM or lxc running your samba server to mount the share folder for other VMs or lxcs connected to the same bridge. (see Solution #1 for fstab mounting). This does not prevent other network devices on different subnets from being able to connect to the samba server using the primary interface IP address.

**Bonus tip: If setting a static IP on your default interface causes DNS resolution problems, it may be resolved by adding appropriate nameservers to the /etc/resolv.conf file.

https://preview.redd.it/ne8v7nqdudzg1.png?width=636&format=png&auto=webp&s=ac32ab4bf28cffd5ed53d51bb992a90f5043d0d3

reddit.com
u/Chedda_Spren — 8 days ago