Virtual VNC screen/workspace

5

2

I've got one monitor (the family TV) attached to my Ubuntu 8.04 system, and when I need to work on it I usually VPN into it from another PC. However I'd like to be able to VPN in even when it's in use as the media center.

Is there a way to create a second virtual monitor/workspace that I could VNC into? I know I could telnet in, but I want the GUI desktop. The graphics card supports multiple screens - should I configure it for another monitor even though there is no other physical monitor?

Fred Hamilton

Posted 2009-08-30T17:44:03.063

Reputation: 2 010

Answers

1

If you are using FreeVNC:

If say your computer name is comp-user-01. You can VNC into a different session by using: comp-user-01:1

I believe you can set how many simultaneous users within the VNC server settings.

Edit: You can replace the last 1 with the number of the session you want to log into.

Sakamoto Kazuma

Posted 2009-08-30T17:44:03.063

Reputation: 833

How do I start and configure the second session? I assume it should be running before I VNC into it (adding ":1" to my computer name doesn't automatically start a new session...does it?) – Fred Hamilton – 2009-08-31T23:41:49.967

Actually I think it does. I think by specifying it, you create it. Not too sure. – Sakamoto Kazuma – 2009-09-01T01:03:30.030

Or you can start the server for the session by entering: "vncserver :2" on the host machine. – Sakamoto Kazuma – 2009-09-01T01:05:34.227

Thanks for the support. OK, I installed tightvncserver and I'm able to start a new "desktop" just as you said. However when I VNC into it it's just a terminal window, although it is in a resizeable GUI window. But I don't have access to any of other Desktop features (menus to launch programs from, etc.). It also looks like a different window manager on the second screen. Is there a way I can make it become a "full" desktop? I'm initially booting with xfce - it would be cool if I could run Gnome or KDE in the second instance - is that possible? – Fred Hamilton – 2009-09-13T23:01:53.877

eek ... That I'm not sure of. – Sakamoto Kazuma – 2009-09-16T13:49:27.620

Thanks, Kazuma-san! That (with Doug providing the final bit) was what I needed. I'd give you both credit for the right answer if I could... – Fred Hamilton – 2009-10-06T06:02:23.297

1

Connect as discussed in Sakamoto Kazuma's answer.

You'll need an xstartup script in ~/.vnc/xstartup. It may already be there. If not, the standard one looks like:

#!/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 &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

Now, uncomment the two lines starting with "# unset " and "# exec " (yeah-- those two just below the comment that says "Uncomment the following two lines for normal desktop"

That should give you your normal, Gnome desktop.

Doug Harris

Posted 2009-08-30T17:44:03.063

Reputation: 23 578

Thanks, that did it! (Sorry it took me so long to try it out!) – Fred Hamilton – 2009-10-06T05:58:26.317

Hmmm...the mouse works great, but whatever I type is getting scrambled: "drat" shows up as "fvan". So I went back to edit ~/.vnc/xstartup (which originally didn't exist so I created it and pasted in your example) and it's been radically changed:

#!/bin/sh

xrdb $HOME/.Xresources xsetroot -solid grey #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #x-window-manager & /etc/X11/Xsession

Any idea what happened? – Fred Hamilton – 2009-10-06T06:25:14.560

OK, the file I created per your instructions was ~/.vnc/xstartup. The "radically changed" file I showed was from ~/vnc/xstartup. Am I supposed to have both .vnc and vnc directories? Which is the real one (I assume .vnc). I'll figure this out eventually... – Fred Hamilton – 2009-10-06T06:45:18.263

Discovered the answer to the keyboard mapping problem by adding 'export XKL_XMODMAP_DISABLE=1' in $HOME/.vnc/xstartup before the last line (/etc/X11/Xsession). Discovered here: https://bugs.launchpad.net/ubuntu/+source/vino/+bug/112955/comments/55

– Fred Hamilton – 2009-10-07T05:25:48.193