WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Serving VNC with realvnc from TinyCore 1.2  (Read 14844 times)

Offline philip

  • Full Member
  • ***
  • Posts: 125
Serving VNC with realvnc from TinyCore 1.2
« on: March 28, 2009, 02:17:43 PM »
Here's how to publish your TC desktop for remote viewing by VNC.

Start by installing the extension realvnc-4.1.1.tcel. (Edit for TC 2.8.1: New name is realvnc.tcz.) It will automatically pull in perl5. Among other things, you get 7 new files in /usr/local/bin:
Code: [Select]
Xvnc4
vnc4config
vnc4passwd
vnc4server
x0vnc4server
x0vncserver
xvnc4viewer
To start the server on virtual display number 1, open a shell and give this command:
Code: [Select]
vnc4server :1It asks for a password. Pick one. Some status messages appear. Everything looks good. It's not usable yet, but some progress has been made. The first run creates a new directory ~/.vnc in which a new file named ~/.vnc/xstartup appears. This file needs your help: edit it for best results. Here's a copy of one that works for me (with all comments removed).
Code: [Select]
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vnc4config -iconic &
jwm &
Comparing the version in the packaged extension, you will see that I had to change 'vncconfig' to 'vnc4config', remove two lines that refer to nonexistent commands ('xsetroot' and 'x-terminal-emulator'), and change 'x-window-manager' to 'jwm'. After making your edits, kill the vnc server, remove the files ~/.vnc/box:1.*, and start the server again.

The directory ~/.vnc/ gets populated with files like box:1.log and box:1.pid when you run a vnc server. The log file is useful when things don't work. More on that later. The number in these filenames refers to the display number you specified in the vnc4server command. Any reasonably small positive integer will work. You can even run several servers at the same time with different display numbers. Each gives a completely independent desktop.

To view your desktop from elsewhere, you need to know the IP address of your TC box. My network device is eth0, so I do this with
Code: [Select]
ifconfig | grep -C 2 eth0I get 'inet addr:192.168.2.111', so on any other machine on the same subnet, I can say
Code: [Select]
vncviewer 192.168.2.111:1to see the TC desktop. (You will need to remember the password you invented earlier.) It's fabulous. Of course, the other machine needs to have some kind of vncviewer installed. Many viewers work--including some whose name gives no clue that VNC is supported, like Ubuntu's built-in vinagre.  You can even get proof-of-concept by using your TC machine to view itself:
Code: [Select]
xvnc4viewer localhost:1(Here I use the viewer that arrived in the realvnc extension package installed earlier.)

Once you have the basics working, you can add options to the vnc server startup line. Search the web for details.

For extra security, you can tunnel your VNC communications through TC's built-in dropbear ssh server. First,  make sure the SSH server is running on the TC box! (There is a button for this on the Control Panel.) Then, on the viewing machine, use the '-via' option when you start the viewer.
Code: [Select]
vncviewer -via tc@192.168.2.111 192.168.2.111:1Two passwords are needed: one to authenticate as user 'tc' on host 'box' (you know that password, right?), and a second to satisfy the VNC server just as in the no-tunnel case.

Tweaks for Xorg
These suggestions work on an absolutely bare-bones installation of TinyCore 1.2. Changing X servers may require more work. (The log file helped me here.) On one of my machines, adding Xorg-7.4.tcel broke the default font path and the VNC server looked like it was starting but then died without any hint that there was a problem. If you don't have this problem, congratulations. Do nothing. If you do, consider creating a couple of symbolic links from the directory where VNC looks for fonts to the directory where Xorg actually stores them:
Code: [Select]
sudo ln -s /usr/lib/X11/fonts/75dpi /usr/share/fonts/75dpi
sudo ln -s /usr/lib/X11/fonts/misc /usr/share/fonts/misc
It's worth mentioning these links in the file /opt/.filetool.lst so they get remembered for next boot:
Code: [Select]
echo /usr/share/fonts/75dpi >> /opt/.filetool.lst
echo /usr/share/fonts/misc >> /opt/.filetool.lst

Tweaks for dropbear
This is off topic. I also run xvnc4viewer on my little TC machine to see desktops elsewhere, through an SSH tunnel as outlined earlier. At first authentication problems shut me out. Eventually trial-and-error led me to a different collection of options for the dropbear service. For what it's worth, here's the dropbear command line I am using now, as reported by "ps | grep bear".
Code: [Select]
/usr/bin/dropbear -w -g -a -b /etc/dropbear/banner
YMMV
It would be interesting to read about the successes and challenges of other VNC users on TC. Go on, hit reply!
« Last Edit: February 18, 2010, 01:06:41 AM by philip »

Offline netzen

  • Newbie
  • *
  • Posts: 34
Re: Serving VNC with realvnc from TinyCore 1.2
« Reply #1 on: April 03, 2009, 01:43:15 AM »
thanks for the information.

It works for me too...

/home/tc/.vnc/xstartup
Code: [Select]
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
jwm &


Offline aris

  • Newbie
  • *
  • Posts: 49
Re: Serving VNC with realvnc from TinyCore 1.2
« Reply #2 on: September 04, 2016, 07:16:05 AM »
I'm on tcl 4.2.9 and vnc4server and having some issue...
here is my log

error opening security policy file /etc/X11/xserver/SecurityPolicy
Could not init font path element /usr/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/lib/X11/fonts/100dpi/, removing from list!
Could not init font path element /usr/local/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/local/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/local/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/local/lib/X11/fonts/100dpi/, removing from list!


I can fix some font error (misc and 75 dpi from the font folder)
/usr/lib/X11/fonts.. I thinks its OK with just 2 fonts..or do I need all ?


I cant find the securitypolicy files on my flwm_topside.
and yes I did change the fwm to flwm_topside on xstartups file
Whre is the security policy files/folder/path


Thank You