- ThinkBlog - http://thinkblog.org -
Linux Tip 003 - VNC defaults
Posted By Michael On 8th October 2003 @ 22:25 In Linux | No Comments
When you’re setting up VNC on your Linux box, after you’ve installed it, you should be able to run a server and immediately log in. It’s a good idea to run “vncserver” with at least the following arguments:
If, for instance, I want for vncserver to start on display 1, I would do “:1″ on the command line after the name of the program itself.
So to recap, the full command line would read thus:
$ vncserver :1 -geometry 1024x768 -depth 16 -cc 4
Now, when you log in for the first time, you might be surprised to find yourself staring at a simple command line window sitting on a barren checkerboard background; and if you run a program from the command line, it pops up with an outline window that you must manually place with the mouse! This is what a [1] Motif setup looks like, and is the most bare-bones graphical user interface available. You’re not actually running Motif, though, you’re running TWM, a highly sparse window manager for POSIX-compliant operating systems (Linux and UNIX are two major ones). This is because, for whatever reason, your Xstartup file wasn’t copied correctly to VNC, so vncserver wrote its own little startup file. If you want to see what it looks like, you can do a “cat ~/.vnc/xstartup” from the commandline when you’re logged in, and the last line on there you’ll see will have “twm&“, which basically tells the window manager you’re looking at right now to run itself.
To correct this problem, assuming you already have a startup file for the X Window System (if you can log in locally to your box and it’s all nice and pretty and comes up with a GNOME or KDE system, you’re fine), you’ll just need a solid text editor (like [2] Emacs or vi, though the former is FAR SUPERIOR). You can stay in your TWM commandline or log in through SSH and execute the following commands to rectify this situation.
FIRST, back up your existing VNC xstartup file:
$ mv ~/.vnc/xstartup ~/.vnc/xstartup.BAK
SECOND, initialize your text editor with a replacement copy of xstartup:
$ emacs ~/.vnc/xstartup
THIRD, place into the file the following text:
#!/bin/sh
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
Save and close the file (”C-x C-s C-x C-c” in Emacs), and kill the current VNC server. Assuming that your display is 1, the command follows:
$ vncserver -kill :1
Then, restart the VNC server thus (or however you usually do):
$ vncserver :1 -geometry 1024x768 -depth 16 -cc 4
Log in to your server through VNC—behold! There have you your precious GUI!
Linux Tip 003 - VNC defaults
Posted By Michael On 8th October 2003 @ 22:25 In Linux | No Comments
When you’re setting up VNC on your Linux box, after you’ve installed it, you should be able to run a server and immediately log in. It’s a good idea to run “vncserver” with at least the following arguments:
If, for instance, I want for vncserver to start on display 1, I would do “:1″ on the command line after the name of the program itself.
So to recap, the full command line would read thus:
$ vncserver :1 -geometry 1024x768 -depth 16 -cc 4
Now, when you log in for the first time, you might be surprised to find yourself staring at a simple command line window sitting on a barren checkerboard background; and if you run a program from the command line, it pops up with an outline window that you must manually place with the mouse! This is what a [7] Motif setup looks like, and is the most bare-bones graphical user interface available. You’re not actually running Motif, though, you’re running TWM, a highly sparse window manager for POSIX-compliant operating systems (Linux and UNIX are two major ones). This is because, for whatever reason, your Xstartup file wasn’t copied correctly to VNC, so vncserver wrote its own little startup file. If you want to see what it looks like, you can do a “cat ~/.vnc/xstartup” from the commandline when you’re logged in, and the last line on there you’ll see will have “twm&“, which basically tells the window manager you’re looking at right now to run itself.
To correct this problem, assuming you already have a startup file for the X Window System (if you can log in locally to your box and it’s all nice and pretty and comes up with a GNOME or KDE system, you’re fine), you’ll just need a solid text editor (like [8] Emacs or vi, though the former is FAR SUPERIOR). You can stay in your TWM commandline or log in through SSH and execute the following commands to rectify this situation.
FIRST, back up your existing VNC xstartup file:
$ mv ~/.vnc/xstartup ~/.vnc/xstartup.BAK
SECOND, initialize your text editor with a replacement copy of xstartup:
$ emacs ~/.vnc/xstartup
THIRD, place into the file the following text:
#!/bin/sh
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
Save and close the file (”C-x C-s C-x C-c” in Emacs), and kill the current VNC server. Assuming that your display is 1, the command follows:
$ vncserver -kill :1
Then, restart the VNC server thus (or however you usually do):
$ vncserver :1 -geometry 1024x768 -depth 16 -cc 4
Log in to your server through VNC—behold! There have you your precious GUI!
Article printed from ThinkBlog: http://thinkblog.org
URL to article: http://thinkblog.org/2003/10/08/linux_tip_003_vnc_defaults/
URLs in this post:
[1] Motif: http://www.opengroup.org/motif/
[2] Emacs: http://www.gnu.org/software/emacs/emacs.html
[3] VNC: http://www.realvnc.com/
[4] Emacs: http://www.gnu.org/software/emacs/emacs.html
[5] denim: http://www.inthe80s.com/clothes/d.shtml
[6] leather: http://www.inthe80s.com/clothes/l.shtml
[7] Motif: http://www.opengroup.org/motif/
[8] Emacs: http://www.gnu.org/software/emacs/emacs.html
[9] VNC: http://www.realvnc.com/
[10] Emacs: http://www.gnu.org/software/emacs/emacs.html
[11] denim: http://www.inthe80s.com/clothes/d.shtml
[12] leather: http://www.inthe80s.com/clothes/l.shtml
Click here to print.