-
Notifications
You must be signed in to change notification settings - Fork 0
vm broker setup vnc server (ubuntu)
Allan Roger Reid edited this page Dec 19, 2023
·
3 revisions
Setup VNC Server on ubuntu
loginctl enable-linger ubuntu
sudo apt update
sudo apt install xfce4 xfce4-goodies -y
sudo apt install tigervnc-standalone-server -y
vncpasswd
cat << EOF > ~/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4
EOF
chmod u+x ~/.vnc/xstartup
sudo vi /etc/systemd/system/vncserver@.service
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=simple
User=ubuntu
PAMName=login
PIDFile=/home/%u/.vnc/%H%i.pid
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :%i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver :%i -geometry 1440x900 -alwaysshared -fg -localhost no
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl stop vncserver@1.service
sudo systemctl enable vncserver@1.service
sudo systemctl start vncserver@1.service
sudo systemctl status vncserver@1.service
to hostname.domain:port where port was previously defined in the lxd node's streams definition e.g.
upstream perforce-bijan-vnc {
server perforce-bijan.lxd:5901;
}
server {
listen 20035;
listen [::]:20035;
proxy_pass perforce-bijan-vnc;
}
To reset
rm -rf /home/allan/.Xauthority-*
ps -ef | grep vnc .. kill
then restart `vncserver`