linux

LXD: Create X11 container

CONTAINER=x11
 
lxc remote add --protocol simplestreams ubuntu-minimal https://cloud-images.ubuntu.com/minimal/releases/
 
lxc launch ubuntu-minimal:22.04 ${CONTAINER}
 
lxc exec ${CONTAINER} -- sudo --login --user ubuntu
sudo apt update
sudo apt install -y x11-apps mesa-utils
exit
 
lxc config set ${CONTAINER} raw.idmap "both $UID 1000"
 
lxc restart ${CONTAINER}
 
lxc config device add ${CONTAINER} X0 disk path=/tmp/.X11-unix/X0 source=/tmp/.X11-unix/X0
lxc config device add ${CONTAINER} Xauthority disk path=/home/ubuntu/.Xauthority source=${XAUTHORITY}

Links
https://blog.simos.info/how-to-run-teamviewer-in-lxd/
https://blog.simos.info/how-to-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/

Install vivaldi

wget -O - http://repo.vivaldi.com/stable/linux_signing_key.pub | sudo apt-key add -
sudo apt-add-repository -y 'deb [arch=amd64] https://repo.vivaldi.com/archive/deb/ stable main'
sudo apt update
sudo apt install -y vivaldi-stable

Create anyconnect VPN connection on command line with nmcli

Create connection

VPN_GATEWAY=vpn1.example.com
VPN_USER=foo
VPN_ROUTES=192.168.11.0/24
 
nmcli connection add \
    connection.id vpn1 \
    connection.type vpn \
    connection.permissions "user:${USER}" \
    ipv4.routes "${VPN_ROUTES}" \
    ipv4.ignore-auto-routes yes \
    vpn.service-type org.freedesktop.NetworkManager.openconnect \
    vpn.data "
        protocol = anyconnect,
        authtype = cert,
        gateway = ${VPN_GATEWAY},
        cacert = ${HOME}/vpn1/ca.pem,
        usercert = ${HOME}/vpn1/certificate.pem,
        userkey = ${HOME}/vpn1/priv.pem,
        cookie-flags = 2
    " \
    vpn.secrets "
        form:main:group_list=CLIENTGROUP,
        form:main:username=${VPN_USER},
        save_passwords=yes
    "

Start connection and enter password once

nmcli connection up vpn1

Debug

#journalctl -fxe NM_CONNECTION=8d5ec3cb-99c5-47ea-84e2-38174cd14702
journalctl -fxe -t NetworkManager
 
cat /etc/NetworkManager/system-connections/vpn1.nmconnection 
nmcli con show vpn1

Links
https://0xsys.blogspot.com/2019/06/configure-vpn-using-nmcli.html