# refracta.freeforums.org

place to talk about refracta

Skip to content

Welcome
Welcome to refracta You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

## x11vnc

Refracta Development, Scripts, etc.
Post a reply
25 posts • Page 2 of 3 • 1, 2, 3

### Re: x11vnc

by nadir » Tue Feb 05, 2013 10:33 pm

I for one don't get the two scripts running (vncss and vncserv)
If i understand correct i will need to already have started X to be able to use x11vnc.
I started etc/init.d/gdm3 start
but that didn't help.
I installed xvfb and uncommented the lines in vncserv, again without success
(now i would need to enable ssh as root, which is something i don't want).
So i herd u liek mudkip?

nadir
  Posts: 1160
  Joined: Wed Mar 09, 2011 4:18 am
  Location: here

Top

### Re: x11vnc

by fsmithred » Tue Feb 05, 2013 11:20 pm

Yeah, I guess you need to enable root login on ssh to get it to work if your user is not logged into an xsession on the server. Using ssh auth keys would be a good idea for that. Then you'd need to run ssh-add before creating the ssh tunnel or before running vncssh. I know how much you love doing that.
I'm not going to change it right now, but I'll play around with tighvncserver and see how it works out. It's voodoo to me, too.
The reason I wrote the scripts is because I couldn't remember the commands. If I can come up with some new commands that I can't remember (for tightvnc) I'll write new scripts.

fsmithred
  Posts: 2101
  Joined: Wed Mar 09, 2011 9:13 pm

Top

### Re: x11vnc

by nadir » Wed Feb 06, 2013 9:52 pm

You _must_ use ssh-agent?
That sounds just plain weird ...
So i herd u liek mudkip?

nadir
  Posts: 1160
  Joined: Wed Mar 09, 2011 4:18 am
  Location: here

Top

### Re: x11vnc

by fsmithred » Wed Feb 06, 2013 11:23 pm

If you're going to use the vncssh script, you would have to add the key before running the script. There's no way to put the key on the ssh command line, which is inside the script.
You could edit the script and add the -i option to the ssh command, but then you'd have to edit the script every time you wanted to connect to a different host.
I could edit the script so that you could put the key on the command line when you start vncssh, but I only just thought of that now.
If you don't use the script, you'd just add the -i option to the ssh command, like you'd normally do.
Oh yeah, you'd first have to ssh in to the remote machine to find the auth file for lightdm and use that on the ssh command line. Or use the vncserv script on the server side, which finds the auth file for you.
Oh yeah, oh yeah - you might not have to do that, because I've noticed that the authfile for lightdm always has the same name (except maybe for the :0 at the end, which I assume is the display.)
So the command would look something like this...

Code: Select all
  `ssh -t -L 5900:localhost:5900 -i /path/to/id_rsa [email protected]
  'x11vnc -auth /var/run/lightdm/root/:0 -localhost -display :0'`

or this:

Code: Select all
  `ssh -t -L 5900:localhost:5900 -i /path/to/id_rsa [email protected]
  '/usr/local/bin/vncserv'`

And then you have to open another terminal and run vncviewer.
vs. using the script:

Code: Select all
  `ssh-add /path/to/id_rsa
  vncssh [email protected]
  `

fsmithred
  Posts: 2101
  Joined: Wed Mar 09, 2011 9:13 pm

Top

### Re: x11vnc

by nadir » Wed Feb 06, 2013 11:58 pm

Ah, i think i see the problem now.
I am using a ssh config file, and i think that solves the problem. But i am not sure.
Anyway: in case i really need ssh-agent i found two workarounds: a) lightdm or b) opening a terminal on a given desktop and use it only for ssh (and vice versa: do ssh only from there).
btw: holy big bang, that is a subject as confusing as can be. Add a firewall and it can't get any worse.
If you really plan to add an option for the ssh-authentication-key, then you might want to add an option for the port too. I said "might". When i looked at the scripts myself i got headaches ...
This sure is handy, the problem is that with my actual network setup i am not sure how to test it (didn't think that hard about Virtualbox yet, but focused on the raspberries. + I got enough hard times to understand it with tightvncserver. Now changing that gives me headaches too. Bit different only, but enough to give me hard times).
So i herd u liek mudkip?

nadir
  Posts: 1160
  Joined: Wed Mar 09, 2011 4:18 am
  Location: here

Top

### Re: x11vnc

by fsmithred » Thu Feb 07, 2013 12:26 am

If you do it in virtualbox, make sure the client is a VM in case you need to kill it, and maybe the server, too, in case you're overwhelmed by the hall of mirrors. (Do it! It's cool, but you should probably close the window that opens pretty soon. Not sure if there's a limit to how many windows will open.)

fsmithred
  Posts: 2101
  Joined: Wed Mar 09, 2011 9:13 pm

Top

### Re: x11vnc

by nadir » Thu Feb 07, 2013 3:23 am

Ok, i can offer a first: It works.
I put the script "vncss" on my desktopPC, at ~/bin and made it u+x.
I started refracta-beta9 in VBox.
I logged in at user.
I ran "vncssh" from the desktop, and foo, i am attached.
I can confirm with
tcpdump port 22
that the connection is over ssh.
(ok, assuming i understand tcpdump correct )
As far i can tell that should be the most common case anyway.
Someone has his desktop running and wants someone else to give him a hand,
watching what the heck he is doing.
Now let me fool with xvfb, then .... zzzzzzz.
Comment?
Ok:
Cool.
Reminds me a bit of unsquashing and squashing iso nightmares, but cool, sure.
So i herd u liek mudkip?

nadir
  Posts: 1160
  Joined: Wed Mar 09, 2011 4:18 am
  Location: here

Top

### Re: x11vnc

by nadir » Thu Feb 07, 2013 3:59 am

K, it took ages to load, but with Xvfb worked too.
I did "alt+ctrl+F2"
etc/init.d/lightdm stop
At desktop i did:
ssh-copy-id -i ~/.ssh/my_key_rsa root@<IP-ofVBox>
eval `ssh-agent`
ssh-add ~/.ssh/my_key_rsa
open another terminal ssh, and start Xvfb (couldn't figure out how to put it to the background)
ssh root@<IP-ofVBox>
Xvfb
back to the other terminal and ran:
vncssh root@<IP-ofVBox>
and after a while i had a session with xfce (slow as hell, but that might well be a VBox problem. I never could connect to Vbox via vnc or such in a speedy way).
btw: It complains about zrle not being a valid "encoding" (or such). No clue what they speak about.
Confusing you say? Ok, here is a more clear version:
Works.
So i herd u liek mudkip?

nadir
  Posts: 1160
  Joined: Wed Mar 09, 2011 4:18 am
  Location: here

Top

### Re: x11vnc

by fsmithred » Thu Feb 07, 2013 4:15 am

I said something wrong above (fixed it). With the script, you don't have to open a second terminal and run vncviewer. It's already in the script. (You already know that - I'm just saying I fixed my post.)
And thanks for testing it.

fsmithred
  Posts: 2101
  Joined: Wed Mar 09, 2011 9:13 pm

Top

### Re: x11vnc

by nadir » Thu Feb 07, 2013 4:19 am

Trying to figure out how to make a pic at dropbox public
(aka: post is probably broken):
hurray ...
Cool. Really cool. You started something amazing there (tunneling, be it vnc or whatever).
So i herd u liek mudkip?

nadir
  Posts: 1160
  Joined: Wed Mar 09, 2011 4:18 am
  Location: here

Top

Previous Next Display posts from previous:
Sort by

Post a reply
25 posts • Page 2 of 3 • 1, 2, 3

Return to Discuss

Jump to:

### Who is online

Users browsing this forum: No registered users and 0 guests

Donate Now
ProNight Style by ModphpBB3
Hosted by © 2017 FreeForums.org | Create a free forum | Powered by phpBB
A Member of the Crowdgather Forum Community
About FreeForums | Legal | Advertise Here | Investors | Contact FreeForums.org
Report Violation
suspicion-preferred