Saturday, April 18, 2020

Creating an NFS share on Proxmox host to share in VMs

The goal is to create a folder on the Proxmox host that we can share on a guest. An NFS share seems to be the recommended way, because a kernel level share folder breaks the high availability paradigm. An advanced user can navigate the command line and force a kernel share, but this causes other problems.

The current setup uses
Proxmox VE 6.1
Ubuntu 18.04

# Install NFS Service on Proxmox
apt install nfs-kernel-server
# Create share folder
mkdir /tank/vmshare
# Share the folder
echo "/tank/vmshare 192.168.1.0/255.255.255.0 (rw,no_root_squash,subtree_check)" >> /etc/exports
exportfs -a
systemctl reload nfs-kernel-server

Now we can mount the NFS share from the guest VM.

# Install the NFS client
sudo apt install nfs-common
# Mount the share
sudo mkdir /mnt/vmshare
sudo chmod 777 /mnt/vmshare
sudo mount 192.168.1.100:/tank/vmshare /mnt/vmshare

TODO: Instructions for autofs to mount the NFS

Saturday, April 11, 2020

Using Linux autofs To Automatically Mount CIFS Shares

AutoFS can be configured to automatically mount shares on directory access.
To do this we will create a config file for the mount, and direct autofs to use this file.

In auto.servername we define how to mount the share .
$ cat /etc/auto.servername
sharename -fstype=cifs,rw,uid=1000,gid=1000,password=Password1 ://servername/sharename

We define the mount location and the auto.servername file to use, appending to the existing /etc/auto.master file.
/mnt/servername /etc/auto.servername

After these are defined, we can reload autofs
sudo systemctl reload autofs

Creating A Samba Share in Debian/Ubuntu (The Right Way)

Because I can never remember how to do this when I need it.
sudo apt-get update
sudo apt-get install samba
net usershare add sharename /path '' Everyone:F guest_ok=y

This is done this way because the Ubuntu GUI will use the usershare capability in nautilus to check for shares. Usershare files are located in:
 /var/lib/samba/usershare/sharename

Friday, July 31, 2015

VLC Command Line Change Container MKV to MP4

I wanted to change a bunch of MKVs to MP4, while doing a direct stream copy. VLC can do this with the GUI, but there was a lot of stuff to remux, so I decided to do it with the VLC CLI instead. Here is the bash one-liner I used:

 for f in *.mkv; do vlc "$f" --sout="#std{access=file,mux=mp4,dst='${f/%mkv/mp4}'}" vlc://quit; done;

I used the following sites for reference:
https://www.videolan.org/doc/streaming-howto/en/ch03.html
https://wiki.videolan.org/Transcode