Samba

Ahmad Hadidi Ahmad Hadidi

Create Template

Alpine 3.18
Make sure it's Unprivileged
[[100 - Samba]]

= this.file.frontmatter.Gateway ^057bcd
$= dv.current().Gateway

![[Genesis]]
let currentPage = dv.current();
let var1 = currentPage.Gateway;

await this.container.createEl('code', {text:var1, cls: [""]});

Create CT

Research: obsidian-dataview/src/ui/render.ts at 4829a8320044dd3bdc3eafa96d628ffc74bacfd6 · blacksmithgu/obsidian-dataview · GitHub
let currentPage = dv.current();
let var1 = currentPage.Gateway;

await this.container.createEl('pre', {text:var1, cls: ["block"]});

let x = "pct create \
"+var1+" \
/mnt/pve/evo/template/cache/alpine-3.18-default_20230607_amd64.tar.xz \
--hostname samba \
--memory 128 \
--net0 name=eth0,bridge=vmbr0,firewall=1,gw= 192.168.0.1,ip=192.168.0.100/24,hwaddr=DE:AD:DE:AD:01:00,type=veth,ip6=dhcp \
--storage localblock \
--rootfs local-lvm:1 \
--unprivileged 1 \
--ignore-unpack-errors \
--ostype alpine \
--password=\"123123123\" \
--start 1"
const ass = this.container.createEl('pre');
ass.createEl('code', {text:x, cls:''});

create

Host

# we need this to hook into internal container data when needed
mkdir /mnt/pve/evo/template_config  

# needed to expose linux ISOs *wink* managed by the CTs
mkdir /mnt/pve/evo/data

# Bind mount
echo "mp0: /mnt/pve/evo/data,mp=/data" >> /etc/pve/lxc/100.conf
echo "mp1: /mnt/pve/evo/template_config,mp=/template_config" >> /etc/pve/lxc/100.conf

# Enter the CT
pct enter 100

# Request IP Address From Router
udhcpc -i eth0 -F $(hostname) -x hostname:$(hostname) -r $(hostname -i)

![[Configs & Resources/Linux/Common/Proxmox#Enable DHCP Leasing - Alpine]]

In CT-Shell

chown root:root -R /data # give samba permissions to manage the ssd
apk add nano
apk add samba
chmod 0777 /data

SMB.conf

nano /etc/samba/smb.conf

# paste this

[storage]
# to follow symlinks
follow symlinks = yes
# to allow symlinks from outside
wide links = yes
browseable = yes
writeable = yes
path = /data                
only guest=no
create mask= 0777     
directory mask= 0777
public=yes
read only=no
force user=root

[template_config]
follow symlinks = yes
wide links = yes
browseable = yes          
writeable = yes
path = /template_config
only guest=no
create mask= 0777
directory mask= 0777
public=yes
read only=no
force user=root

# restart samba
service samba restart

CT Shares

119 - Paperless-Ngx

![[119 - Paperless-Ngx#Samba Share]]

Ref

  1. Setting up a Samba server - Alpine Linux
  2. Unprivileged LXC containers - Proxmox VE