https://blog.simos.
info/how-to-use-virtual-machines-in-lxd/
https://blog.simos.info/how-to-run-a-windows-virtual-machine-on-lxd-on-linux/
https://blog.simos.info/i-am-running-steam-wine-on-ubuntu-19-10-no-32-bit-on-the-
host/ <--- funziona
LOGIN
lxc exec steam -- sudo --user ubuntu --login
Ambiente grafico
apt-get update
apt-get install xvfb
Xvfb :1 -screen 0 1024x768x16 &> xvfb.log &
DISPLAY=:1.0
export DISPLAY
sudo apt-get install libvirt-daemon-driver-lxc
sudo apt-get install virt-bootstrap virt-top evtest iotop
crea il file x11.profile sul pc
---------------------------
config:
environment.DISPLAY: :0
environment.PULSE_SERVER: unix:/home/ubuntu/pulse-native
nvidia.driver.capabilities: all
nvidia.runtime: "true"
user.user-data: |
#cloud-config
runcmd:
- 'sed -i "s/; enable-shm = yes/enable-shm = no/g" /etc/pulse/client.conf'
packages:
- x11-apps
- mesa-utils
- pulseaudio
description: GUI LXD profile
devices:
PASocket1:
bind: container
connect: unix:/run/user/1000/pulse/native
listen: unix:/home/ubuntu/pulse-native
security.gid: "1000"
security.uid: "1000"
uid: "1000"
gid: "1000"
mode: "0777"
type: proxy
X0:
bind: container
connect: unix:@/tmp/.X11-unix/X1
listen: unix:@/tmp/.X11-unix/X0
security.gid: "1000"
security.uid: "1000"
type: proxy
mygpu:
type: gpu
name: x11
used_by: []
--------------------------
$ lxc profile create x11
Profile x11 created
$ cat x11.profile | lxc profile edit x11
$
Create storage
lxc storage create pool dir
lxc launch ubuntu:22.10 --profile default --profile x11 -s pool helpdesk
sudo lxc exec rpool bash
lxc list
sudo lxc stop rpool
lxc launch images:ubuntu/16.04 workshop (or 18.04, it doesn't make a difference)
Install ambiente grafico
lxc config set helpdesk security.privileged true
apt install lxde xrdp
another option is to install x2go (www.x2go.org)
In the container you would need to install:
$ sudo add-apt-repository ppa:x2go/stable $ sudo apt update $ sudo apt install
x2goserver x2goserver-xsession
in your Host:
$ sudo add-apt-repository ppa:x2go/stable $ sudo apt update $ sudo apt install
x2goclient
Most remote desktop applications have a problem with gnome3 (unity too) but lxde,
xfce, mate etc all work great.
xrdp works really well also and I see you now have that working so I'm posting this
just so you have a 2nd option.
CONSOLE
sudo lxc exec rpool bash
SSH
In /etc/ssh/sshd_config, add and/or set:
HostkeyAlgorithms ssh-rsa
Running X11 software in LXD containers
----------------------------------------
https://blog.simos.info/running-x11-software-in-lxd-containers/
802 sudo lxc
803 lxc launch
804 lxc launch ubuntu:22.04 u1
805 sudo lxc launch ubuntu:22.04 u1
807 lxc launch
808 lxc
809 lxc -v
810 lxc --all
811 lxc list
812 sudo lxc launch ubuntu:22.04 u1
813 sudo lxc start u1
818 lxc
819 lxc list
820 lxc info
821 lxc
822 sudo lxc launch ubuntu:22.10 u1
826 sudo lxc launch ubuntu:22.10 rpool
827 lxc list
829 $ ls /usr/share/lxc/templates/
830 lxc list
831 sudo lxc exec rpool
832 sudo lxc exec rpool -- ip a
833 sudo lxc exec rpool -- pwd
834 sudo lxc storage list
835 sudo lxc image list image
836 sudo lxc image list images
837 sudo lxc list
838 sudo lxc stop rpool
839 sudo lxc list
840 sudo lxc start rpool
841 sudo lxc list
845 lxc attach -n rpool
846 sudo lxc attach -n rpool
847 sudo lxc attach -n rpool
848 lxc
849 sudo lxc console -n rpool
850 sudo lxc console rpool
852 sudo lxc image list images:
853 sudo lxc exec rpool bash
854 lxc list
857 sudo lxc exec rpool bash
797 sudo apt install lxd-installer
798 lxd
799 sudo lxd
801 lxd
806 sudo lxd init
815 lxd
816 sudo lxd
817 sudo lxd -h
823 lxd init
859 history |grep lxd