Friday Sep 26, 2008

Configuring vnc

I want to run a vnc server on a remote box and almost all examples give you twm. I'm just so used to gnome by now.

So here is what I get with twm:

jhereg % vncserver

New 'jhereg:1 (th199096)' desktop is jhereg:1

Starting applications specified in /home/th199096/.vnc/xstartup
Log file is /home/th199096/.vnc/jhereg:1.log

jhereg % more .vnc/xstartup
#!/bin/sh

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid black
gnome-terminal &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

Lets kill it and try another xstartup:

jhereg % vncserver -kill :1
Killing Xvnc process ID 102149
jhereg % cp .vnc/xstartup .vnc/xstartup.twm
jhereg % cp .vnc/xstartup2 .vnc/xstartup
jhereg % cat !$
cat .vnc/xstartup
#!/bin/sh

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid black
gnome-session&
gnome-terminal --geometry 80x24+10+10 --title="My Desktop" &
gnome-terminal &

jhereg % vncserver

New 'jhereg:1 (th199096)' desktop is jhereg:1

Starting applications specified in /home/th199096/.vnc/xstartup
Log file is /home/th199096/.vnc/jhereg:1.log

Hmm, my text windows are a bit small and the wrong color, but I can fix that.

I fixed the color by changing properties for the default profile, but I can't get the windows to start up properly. If I manually start one with the same options, everything is okay. Weird.

Update: After a panic on my system, when I started vncserver back up, the windows were sized accordingly.


Originally posted on Kool Aid Served Daily
Copyright (C) 2008, Kool Aid Served Daily

Sometimes google.com is faster than find, especially when you do the find wrong

I wanted to run a vnc server on a remote lab machine:

jhereg % vncserver 
vncserver: couldn't find "Xvnc" on your PATH.
jhereg %  which Xvnc
Xvnc: Command not found.

Hmm, I used to run it on another machine:

iquad % which Xvnc
/opt/sfw/bin/Xvnc
iquad % df -h /opt/sfw/bin/Xvnc
Filesystem             size   used  avail capacity  Mounted on
pool/sfw_s10_ccd-02-i386
                       1.8T   1.5G   590G     1%    /pool/sfw/s10_ccd-02-i386

Why isn't jhereg mounting that?

I found out why on another box:

aus1500-home % cat /etc/auto_direct 
#
# Solaris Freeware
#
# /opt/sfw is severely out of date.  many of these freeware utils
# are already in NV.  commented out for now to see who yells.
#/opt/sfw -ro,nosuid iquad:/pool/sfw/s10_ccd-02-$CPU/opt/sfw

Okay, I could install it or even yell. But why don't we see if Xvnc is on jhereg, but not in my path?

[root@jhereg /]> find . ! -local -name Xvnc
find: cannot read dir ./usr/dist/lost+found: Permission denied
./usr/dist/share/vnc,v4.1.2/5bin.sun4/Xvnc
./usr/dist/share/vnc,v3.3.7/5bin.sun4/Xvnc

But even before I got the positive hits out, I had used google on solaris Xvnc to find this link: System Administration Guide: Virtualization Using the Solaris Operating System and found this: Starting VNC

# Add an instance of x11-server service called display1 for configuration, and configure it to run Xvnc.

svccfg -s application/x11/x11-server add display1
svccfg -s application/x11/x11-server:display1 addpg options application
svccfg -s application/x11/x11-server:display1 addpropvalue options/server: "/usr/X11/bin/Xvnc"


svccfg -s application/x11/x11-server:display1 addpropvalue options/server: '"SecurityTypes=None"'

And we get:

jhereg % ls -la /usr/X11/bin/Xvnc
-r-xr-sr-x   1 root     root     4706264 Sep  5 14:30 /usr/X11/bin/Xvnc

And meanwhile the find is finally at:

./usr/dist/share/vnc,v4.1.2_01/5bin.i86pc/Xvnc
./usr/dist/share/vnc,v4.1.2_01/5bin.sun4/Xvnc
./usr/dist/share/vnc,v4.1.2_01/5lib.i86pc/Xvnc
./usr/dist/share/vnc,v4.1.2_01/5lib.sun4/Xvnc
./usr/dist/exe/Xvnc

Are they the same?

jhereg % ls -la /usr/X11/bin/Xvnc
-r-xr-sr-x   1 root     root     4706264 Sep  5 14:30 /usr/X11/bin/Xvnc
jhereg % ls -la /usr/dist/exe/Xvnc 
lrwxrwxrwx   1 softdist softdist       3 Apr 21  2005 /usr/dist/exe/Xvnc -> cam
jhereg % ls -la /usr/dist/exe/cam
lrwxrwxrwx   1 root     other         28 Sep 15  2001 /usr/dist/exe/cam -> ../pkgs/cam/softdist/exe/cam
jhereg % ls -la /usr/dist/exe/../pkgs/cam/softdist/exe/cam
lrwxrwxrwx   1 softdist softdist      19 Feb 12  2007 /usr/dist/exe/../pkgs/cam/softdist/exe/cam -> .cam,v1.8.3_wrapper
jhereg % ls -la /usr/dist/exe/../pkgs/cam/softdist/exe/.cam,v1.8.3_wrapper
-rwxr-xr-x   1 softdist softdist   14303 May  9  2007 /usr/dist/exe/../pkgs/cam/softdist/exe/.cam,v1.8.3_wrapper
jhereg % file /usr/dist/exe/../pkgs/cam/softdist/exe/.cam,v1.8.3_wrapper
/usr/dist/exe/../pkgs/cam/softdist/exe/.cam,v1.8.3_wrapper:     executable shell script

No, I don't think so...

Perhaps I should have been smarter on my find?

[root@jhereg /]> find /usr/X11 -name Xvnc
/usr/X11/bin/Xvnc
[root@jhereg /]> find / -name Xvnc
/usr/X11/bin/Xvnc
\^C

Much faster and it looks like I misread the man page for find(1). See example 9 for what I didn't read close enough:

     Example 9 Printing Local Files without Descending  Non-local
     Directories

       example% find . ! -local -prune -o -print

I have friends who would say I should just discard this article and act like nothing happened. But where is the fun in that? Big :->

Originally posted on Kool Aid Served Daily
Copyright (C) 2008, Kool Aid Served Daily
About

tdh

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today