Vnc

From The World according to Vissie
Jump to navigation Jump to search

setup environment

vnc

vncserver -localhost -depth 24 -geometry 1200x900 :1 &
vncserver -kill :1
vncserver -geometry 1440x900 -alwaysshared -dpi 96 :1 -rfbport 1234

(in noVNC dir)

cp ./vnc_lite.html ./index.html
# http://xmodulo.com/access-vnc-remote-desktop-web-browser.html
xrdb: No such file or directory.
xrdb: Can't open file '/home/<user>/.Xresources'

You should create the correct file, and TightVNC will populate it automatically. This can be done with the command:

touch ~/.Xresources

minimal vps server setup

git clone https://github.com/novnc/noVNC.git
sudo apt-get install openbox
sudo apt-get install vnc4server
or pacaur -S vnc4server
touch ~/.Xresources
mkdir ~/.vnc 
vim ~/.vnc/xstartup
vim: ~/.vnc/xstartup
exec openbox-session
chmod 755 ~/.vnc/xstartup
vncserver -localhost -depth 24 -geometry 600x400 :1
sudo apt-get install xfce4-terminal openbox dbus-x11 xfdesktop4 xfce4-panel gnome-themes-standard lxappearance chromium
sudo apt-get install python-pip
sudo pip install numpy (for better performance) 
mkdir -p ~/.config/openbox/
vim: ~/.config/openbox/autostart
xfdesktop &
xfce4-panel &
(For stretch add this line to your sources.list)
deb http://ftp.debian.org/debian stretch-backports main
sudo apt-get install certbot -t stretch-backports
sudo certbot certonly --standalone -d mydomain.com
(spin up a temp webserver)


vim: ~/src/noVNC/start_noVNC.sh
#/bin/bash
echo "First we start vncserver....."
vncserver -geometry 1440x900 -alwaysshared -dpi 96
echo "Then we start noVNC"
sudo ./utils/launch.sh --vnc localhost:5901 --listen 9900


Testing

sudo apt-get install xtightvncviewer
vncviewer localhost:5901
./utils/launch.sh --vnc localhost:5901
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
sudo ./utils/launch.sh --vnc localhost:5901 --listen 443
sudo ./utils/websockify/run --ssl-only --web /home/user/src/noVNC --cert /etc/letsencrypt/live/mydomain.com/fullchain.pem --key 
/etc/letsencrypt/live/mydomain.com/privkey.pem 443 localhost:5901