Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
x11vnc: Connect to a Running Desktop Easily
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Mon Oct 04, 2004 11:06 pm    Post subject: x11vnc: Connect to a Running Desktop Easily Reply with quote

http://www.karlrunge.com/x11vnc/

I've had this question ever since I installed linux. How do I connect to my running desktop remotely, exactly like VNC does on Windows (which is where I first started using vnc)?

Through the forums here, I had read about x0rbserver (not sure if that's spelled correctly..) and even tried it a few times, but I was still puzzled by the lack of a "built-in" ability to do this naturally with vnc. It just didn't make sense.

So, here's the quick steps to getting this working with very little hassles (and very little security, but the above URL covers that):
[home machine]$ emerge libvncserver
[home machine]$ x11vnc -display :0

[public terminal]$ vncviewer <home machine>:0


...doesn't get much simpler than that, folks.

I'm not sure if the option at this link is known to everyone, but I just recently stumbled on it myself, and thought I'd share, as it's an excellent step-by-step howto. All that was necessary was to emerge libvncserver, and then grab a vncviewer to get started. I happened to already have tightvnc installed, which came with a viewer, but I'm sure the viewer can be downloaded separately (or just stick it up in a web-accessible place).

So, I'm not really sure why I hadn't heard mention of this, in my opinion, extremely simple method that seems to already be entirely built into libvncserver. Remember, tunnelling through SSH is a good idea. Hope this helps someone!
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
ShutterBC
n00b
n00b


Joined: 17 Sep 2004
Posts: 5
Location: Boston, MA

PostPosted: Thu Oct 07, 2004 8:29 pm    Post subject: Reply with quote

Any idea why this seems to be much faster than using krfb?
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Fri Oct 08, 2004 2:30 pm    Post subject: Reply with quote

Heh, no idea. So far I've been very pleased with the performance, especially using tightvnc encoding. Even not using tightvnc, I was able to work on my home system from the office, which means going through two cable modems, both of which are heavily shared. The performance was much better than pcAnywhere.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
zenon
Apprentice
Apprentice


Joined: 09 Oct 2002
Posts: 263

PostPosted: Sat Oct 09, 2004 9:24 pm    Post subject: Reply with quote

here's some more VNC info if NE wants:
http://www.umanitoba.ca/acn/unix/software/vendor_html/vnc/documentation.html


everything in linux 'flava' is better/faster, that's just a fact of life!
Back to top
View user's profile Send private message
zenon
Apprentice
Apprentice


Joined: 09 Oct 2002
Posts: 263

PostPosted: Sat Oct 09, 2004 9:30 pm    Post subject: Reply with quote

I have ports 5900-5910 opened on my firewall (TCP and UDP) and get this error:
Code:
root@zen zenon # vncviewer mycomp.com:0
vncviewer: ConnectToTcpAddr: connect: Connection refused
Unable to connect to VNC server


does that mean I need to change my firewall settings?
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Sun Oct 10, 2004 1:57 am    Post subject: Reply with quote

Are you sure the x11vnc program was able to use ports in that range? The firewall would definitely be something to check, but first make sure the ports are right. x11vnc should print out what it's using when started.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
Farkenell
Tux's lil' helper
Tux's lil' helper


Joined: 05 Dec 2003
Posts: 88

PostPosted: Sun Oct 10, 2004 4:39 am    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic.php?t=72893

I think this is what you maybe lookin for?
was pretty easy to do...I got it first go...
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Sun Oct 10, 2004 2:59 pm    Post subject: Reply with quote

Farkenell, I believe the difference between this thread and the one you linked is the fact that this one is for connecting to a currently running desktop. It's not a terminal server, like the other one. Both have their uses, and I've made use of the terminal server type of installation before, but this thread is only useful if you want to connect to your screen as you left it.

So, if you started GAim at home, this thread shows you how to connect to the system and see the -currently running- gaim session.

The thread you link to allows you to connect to the home system, but start up a brand new session. You don't interfere with the applications currently running, and in fact, can't interact with them.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
CriminalMastermind
Tux's lil' helper
Tux's lil' helper


Joined: 19 Nov 2003
Posts: 132
Location: toronto

PostPosted: Tue Oct 12, 2004 11:28 pm    Post subject: Reply with quote

well i don't have vnc setup to connect to my :0 display, but it appears there is another way to do this. here is the link from the realvnc ver 4 faq.... incase anyone wants to know another way this could be done.
_________________
"I can picture a perfect world that knows of no war... and I can picture me attacking that world, because they'd never expect it."
Back to top
View user's profile Send private message
RexM
n00b
n00b


Joined: 12 Aug 2004
Posts: 47
Location: South Jordan, Utah

PostPosted: Wed Oct 13, 2004 2:17 pm    Post subject: Reply with quote

ShutterBC wrote:
Any idea why this seems to be much faster than using krfb?


http://www.karlrunge.com/x11vnc/ wrote:
x11vnc is written in plain C and uses only standard libraries.


That could possibly be the reason ;)
Back to top
View user's profile Send private message
Entropy42
n00b
n00b


Joined: 05 Mar 2004
Posts: 56

PostPosted: Wed Oct 13, 2004 5:22 pm    Post subject: Reply with quote

Just curious:

Will things that normally run very slowly over VNC (video, 3D acceleration) work on the local display when doing this? Or will they be slow locally also.

i.e. if I set this up, will I be able to run xine and quake3 when sitting locally at the machine, but be able to connect and use non-video/3D apps when connecting remotely?
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Wed Oct 13, 2004 9:40 pm    Post subject: Reply with quote

Entropy42, vnc works by monitoring your local screen for changes and then sending only those blocks that change to the remote client. When I'm using vnc on the 10mbps LAN here, it's only slightly slower than actually sitting at the machine. When I connect to home from the office, it's usable, but things like scrolling, or dragging an entire window, are noticeably slower and should be avoided.

That being said, things like XINE and 3D acceleration are a different matter altogether. In general, the content in video windows will not show up on the remote viewer, simply because of the more efficient way the video player deals with your video memory. I don't know at all how it technically works, but it's called "overlay," and that only works locally. The same would go for 3D acceleration. It does not, however, slow down the response at all. The video content simply doesn't get copied to the remote viewer. In its place will be a black (green, fuscia) box.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
skwashy
n00b
n00b


Joined: 26 Jan 2004
Posts: 1
Location: Utah, USA

PostPosted: Sat Oct 16, 2004 1:52 am    Post subject: Reply with quote

Any idea why x11vnc quits when my remote viewer closes?

Maybe I missed something?

Code:
observer root # x11vnc -display :0
viewonly:   0
shared:     0
conn_once:  1
mod_tweak:  0
loc_curs:   1
mouse:      0
root_curs:  0
defer:      30
waitms:     30
take_naps:  0
threads:    0
fs_frac:    0.60
gaps_fill:  4
grow_fill:  3
tile_fuzz:  2
use_hints:  1
Using display :0
Read initial data from display into framebuffer.
using 16bpp depth=16 true colour
16/10/2004 01:24:30 Autoprobing TCP port
16/10/2004 01:24:30 Autoprobing selected port 5900
PORT=5900
screen setup finished.
16/10/2004 01:24:44 Got connection from client 192.168.1.20
16/10/2004 01:24:44   other clients:
16/10/2004 01:24:44 Protocol version 3.3
16/10/2004 01:24:44 Pixel format for client 192.168.1.20:
16/10/2004 01:24:44   8 bpp, depth 8
16/10/2004 01:24:44   true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
16/10/2004 01:24:44 Using ZRLE encoding for client 192.168.1.20
viewer exited.
observer root #

_________________
Laptop: P4 2.4GHz, 512MB, 40GB (WinXP/Gentoo)
Workstation: AMD XP 2000+, 512MB, 2x Maxtor 80GB. (WinXP)
Workstation: AMD T-Bird 1.33GHz, 512MB, WD 80GB (Gentoo)
Proliant Server: Intel Dual-P3 500MHz, 512MB, 2x SCSI 9.1GB, 2x Maxtor 80GB (Gentoo)
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Sat Oct 16, 2004 3:56 am    Post subject: Reply with quote

skywashy, that's the default behaviour. If you want to leave the connection open for the next client, start the server like this:

x11vnc -forever -display :0

...mentioned here.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
Sugarat
Guru
Guru


Joined: 24 Jul 2002
Posts: 348

PostPosted: Fri Feb 11, 2005 1:04 pm    Post subject: Reply with quote

I've emerged x11vnc but when I try to run it it is saying

Code:

11/02/2005 13:22:13 x11vnc version: 0.7pre lastmod: 2004-12-23
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

11/02/2005 13:22:13 XOpenDisplay failed (:0.0)


_________________
--[ UltraSPARC ]--
Accept no imitations
Back to top
View user's profile Send private message
LeTene
Guru
Guru


Joined: 02 Mar 2004
Posts: 348
Location: Ah'll glass ye!

PostPosted: Fri Feb 11, 2005 3:51 pm    Post subject: Reply with quote

A tip here that should work with any VNC variant - use SSH tunneling to avoid having to open any 59xx ports. I use Windows XP at work, so I use PuTTY to do the job for me. You'll need your SSH port open in the firewall, but I think most people will aready have this set up...

Assuming that the VNC server on your home machine runs on display :1 (which usually equates to port 5901) this works great for me:
  • In PuTTY's Tunnels section, enter 5901 into the Source port box, localhost:5901 into the Destination box, and then press the Add button (you'll see L5901 localhost:5901 appear in the listbox just above those edit boxes).

  • Now go back to PuTTY's Session section, fill in your home machines address and connect & log in. You now have a tunnel connecting your local work machines port 5901 to your remore home machine.

  • Now fire up your Windows VNC client, and for the Server, specify localhost:1, press your Connect button and enter your password.

That's it!
_________________
Docs, Tips & Tricks at the Gentoo Wiki page.
Back to top
View user's profile Send private message
dezydery
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jul 2004
Posts: 87

PostPosted: Fri Feb 11, 2005 11:00 pm    Post subject: Reply with quote

Sounds good... but can this also be done with FreeNX (i.e. connect to running X session)?
Back to top
View user's profile Send private message
cron0
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jan 2004
Posts: 132
Location: Montreal, Quebec

PostPosted: Wed Feb 16, 2005 2:13 pm    Post subject: Reply with quote

Emerged libvncserver: emerge -v libvncserver

But it produced NO x1vnc binary.

Any clues?

Edit: got it, it is now called "x11vnc!" .... emerge x11vnc
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Mon Mar 14, 2005 1:55 am    Post subject: Reply with quote

Hey I emerged this put it will not run. Anyone else have this problem?

Code:
illusion init.d # x11vnc -display :0

Settings:
 display:    :0
 authfile:   null
 subwin:     0x0
 -sid mode:  0
 flashcmap:  0
 force_idx:  0
 visual:     null
 overlay:    0
 ovl_cursor: 1
 scaling:    0 1.00000
 viewonly:   0
 shared:     0
 conn_once:  1
 timeout:    0
 inetd:      0
 connect:    null
 connectfile null
 vnc_conn:   1
 allow:      null
 input:      null
 passfile:   null
 accept:     null
 gone:       null
 users:      null
 using_shm:  1
 flipbytes:  0
 onetile:    0
 solid:      null
 blackout:   null
 xinerama:   0
 xrandr:     0
 xrandrmode: null
 padgeom:    null
 logfile:    null
 logappend:  0
 rc_file:    ""
 norc:       0
 bg:         0
 mod_tweak:  1
 isolevel3:  0
 xkb:        0
 skipkeys:   null
 addkeysyms: 0
 xkbcompat:  0
 clearmods:  0
 remap:      null
 norepeat:   1
 nofb:       0
 watchbell:  1
 watchsel:   1
 watchprim:  1
 cursor:     1
 multicurs:  0
 curs_mode:  null
 xfixes:     1
 alphacut:   240
 alphafrac:  0.33
 alpharemove:0
 alphablend: 1
 cursorshape:1
 cursorpos:  1
 xwarpptr:   0
 buttonmap:  null
 dragging:   1
 ptr_mode:   2
 inputskip:  10
 speeds:     null
 debug_ptr:  0
 debug_key:  0
 defer:      30
 waitms:     30
 take_naps:  1
 sb:         60
 sigpipe:    null
 threads:    0
 fs_frac:    0.75
 gaps_fill:  4
 grow_fill:  3
 tile_fuzz:  2
 snapfb:     0
 gui:        0
 gui_mode:   null
 noremote:   0
 safemode:   1
 deny_all:   0
 
13/03/2005 09:50:06 x11vnc version: 0.7.1 lastmod: 2005-02-23
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
 
13/03/2005 09:50:06 XOpenDisplay failed (:0)
illusion init.d #     
Back to top
View user's profile Send private message
Xamindar
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1155
Location: California

PostPosted: Mon Mar 14, 2005 3:57 am    Post subject: Reply with quote

Ok, I got it. It just couldn't find the xauthority file which was located here:

Code:
/var/lib/xdm/authfiles/A\:0-usXZLI


strange file name but it worked.

Can someone help me out with getting it to load on boot? This looks like a random xauthority file so I would probably need a startup script that would get the xauthority each time. I have no experience with scripts though.

Anyone already doing this? Or is there a better way to have an vnc-able X server?

EDIT: yes, that xauthority file's name changes on each reboot. How can I input that into the x11vnc command automaticaly?
Back to top
View user's profile Send private message
Danuvius
Guru
Guru


Joined: 18 Sep 2004
Posts: 375
Location: Toronto

PostPosted: Sat Mar 26, 2005 10:29 pm    Post subject: Re: x11vnc: Connect to a Running Desktop Easily Reply with quote

OdinsDream wrote:
So, here's the quick steps to getting this working with very little hassles (and very little security, but the above URL covers that):
[home machine]$ emerge x11vnc
[home machine]$ x11vnc -display :0

[public terminal]$ vncviewer <home machine>:0


Thanks! This works great for me. I've been looking for a simple way to use my at-home work machine (gentoo) from my at-home family computer (windows xp).

OdinsDream wrote:
So, I'm not really sure why I hadn't heard mention of this, in my opinion, extremely simple method that seems to already be entirely built into libvncserver. Remember, tunnelling through SSH is a good idea. Hope this helps someone!


Having said that, literally all I did was what you have above. Is my connection terribly insecure? I am behind a router, so I'm not terribly paranoid. But at the same time, I am not looking to have a 'please hack me' setup either. How do I do the ssh tunneling?

Lastly, my one woe with this: I cannot type a double quote (e.g.: "). (That one was copied and pasted.) When I press shift+' I still only get '.

Admittedly this might be the fault of the vnc program I am using to connect. Still, thought I'd mention it in case someone has ideas.

Sincerely,

Danuvius
Back to top
View user's profile Send private message
gaboonal
n00b
n00b


Joined: 05 Mar 2004
Posts: 49

PostPosted: Mon Mar 28, 2005 8:42 pm    Post subject: Reply with quote

I have two computers, one running Gentoo and one running Windows XP. The one running Windows has 256MB RAM and a 650MHz CPU and the one running Gentoo has 1GB RAM and a 3.2GHz CPU. On a 100Mbps LAN, when I connect to the one running Gentoo from the one running Windows or vice versa I get 100% CPU when moving Windows, scrolling etc. on the computer running Windows. This is the case even with compression disabled. Both machines are running TightVNC.

Is there a way to make this usable? If not, is there an alternative? I need to be able to log onto the current X session. Can this be achieved with a normal X server?
Back to top
View user's profile Send private message
dewke
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2004
Posts: 76
Location: back in the black hole

PostPosted: Wed Apr 06, 2005 8:34 pm    Post subject: Reply with quote

gaboonal wrote:
I have two computers, one running Gentoo and one running Windows XP. The one running Windows has 256MB RAM and a 650MHz CPU and the one running Gentoo has 1GB RAM and a 3.2GHz CPU. On a 100Mbps LAN, when I connect to the one running Gentoo from the one running Windows or vice versa I get 100% CPU when moving Windows, scrolling etc. on the computer running Windows. This is the case even with compression disabled. Both machines are running TightVNC.

Is there a way to make this usable? If not, is there an alternative? I need to be able to log onto the current X session. Can this be achieved with a normal X server?


You need to up the ram on your XP box. My laptop only had 256mb and XP was barely usable until I added more ram.
_________________
Oderint dum metuant
-Caligula
Back to top
View user's profile Send private message
ikke
Apprentice
Apprentice


Joined: 14 Jan 2005
Posts: 225
Location: Belgium

PostPosted: Wed Apr 06, 2005 9:59 pm    Post subject: Reply with quote

If you're running Gnome you get this functionality automagically through Vino.
_________________
Working day and night to enhance your Linux Desktop experience :)
Blog
Back to top
View user's profile Send private message
gaboonal
n00b
n00b


Joined: 05 Mar 2004
Posts: 49

PostPosted: Thu Apr 07, 2005 10:26 pm    Post subject: Reply with quote

Upgrading the RAM is not an option unfortunately. I don't run gnome, I run fluxbox. I now have Ubuntu Linux running on the slower machine on dual boot.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum