Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

XFCE

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-20-04

WD=/opt/vnc
mkdir -p $WD/setup
cd $WD/setup
cat << 'EOF' >/opt/vnc/setup/vnc_xfce_setup.sh
#!/bin/bash

apt update
apt install -y xfce4 xfce4-goodies 
apt install -y tightvncserver
vncpasswd
vncserver
echo vncserver -kill :1
echo 'alias vnckill="vncserver -kill :1"' >> ~/.bashrc
source ~/.bashrc

cat << 'FOE' >~/.vnc/xstartup
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
FOE
chmod +x ~/.vnc/xstartup


cat << 'OFE' >/etc/systemd/system/vncserver@.service

[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=root
Group=root
WorkingDirectory=/root

PIDFile=/root/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target
OFE

systemctl daemon-reload
systemctl enable  vncserver@1.service
systemctl start vncserver@1.service
systemctl status vncserver@1.service
EOF
chmod +x /opt/vnc/setup/vnc_xfce_setup.sh
/opt/vnc/setup/vnc_xfce_setup.sh
  • No labels