# Remote desktop access using VNC or the like [solved]

## batistuta

I'd like to access my Gentoo box from a Windows machine far away from home. Which options do I have? I've heard of VNC, and when looking around, I've found two wikis

HOWTO Use VNC to connect to existing X Sessions

http://gentoo-wiki.com/HOWTO_Xvnc_terminal_server

and

HOWTO Xvnc terminal server - Gentoo Linux Wiki

http://gentoo-wiki.com/HOWTO_Use_TightVNC_W/_JPEG_Compression_to_connect_to_existing_X_Sessions

What is the difference between the two? I've heard so many things with the word VNC that I'm totally confused   :Rolling Eyes: 

That's for the server side. On the client side, which options do I have? I've heard of some Java applet that allows you to connect in a secure way, but I'm not sure. I'm planning to connect through public internet, so a secure connection is a must (although this is my fun-box, nothing work realted or highly critical)

Any recommended how-to around? Thanks

PS: anyone knows how to bend the URL link inside some text when writing in the forums? I always end up writing in two lines like above, but I've seen people merging them.Last edited by batistuta on Thu Feb 09, 2006 12:31 am; edited 1 time in total

----------

## Albert_g

You can use vnc in two different ways:

1st : using an existing X11 session ( already running ) so you would be like if you were sitting in front of the controlled computer, and anybody looking at the display would see the mouse moving, etc.

2nd : as a terminal server, you can make vnc start a hidden X11 session for you 'a la ssh/telnet', so it will not have a phisical display on the controlled computer, and nothing will be seen on its display.

The first method allows you to access already running programs, and lef them continue until you get back home, but it limits you to ONE concurrent user per running X11 session. Recommended to access your home coputer from work.

The second method allows you to spawn as many X11 sessions as needed ( and supported by the host computer ), without having to start them in advance. Recommended to use one single computer to server may users as if they were using its keyboard and display.

Remember to add the server flag to the USE environement prior to emerge the x11vnc ( for 1st way ) or vnc (2nd way) on the home computer.

The command line allows you to select encription, password, and so on. 

Albert

----------

## tuxmin

I would go for freenx on the Gentoo side. The performance is considerably better, especially over low bandwidth connections.

The Windows client is downloadable for free from nomachine. And you get an encrypted connection for free.

Alex!!!

----------

## batistuta

thanks guys for the suggestions. 

Is it possible to actually have all three options? That would be freenx, a vnc server that you can connect to and control the already logged in session, and the ability to also spawn a new one? My computer is always on and I don't usually log out. I might then want to control my session while I'm away. When I'm gone and have the laptop with me, I'll use freenx. When in an internet cafe or somewhere where I can't install apps, I'll access via some vnc client-applet. But then it could happen that I want friends to also have access to it. So I would like all three.  :Very Happy: 

Can they cohexist?

I'll give it a try after my world (800 packages) finishes recompiling with gcc4, if that ever happens   :Laughing: 

----------

## madchaz

Shouldn't be a problem, but remember that having more then one X session open at a time can cause issues, because of the lock files for your applications. Thunderbird and Firefox won't play nice, for exemple. 

Personaly, I'd sujest using SSH to start whatever you plan to use atm. (Say a hiden VNC session. Works just like a normal one and you can disconnect and reconnect without closing anything in it. Plus the client is just a single .exe, so no install needed)

This way, you avoid having multiple sessions open with the associated issues.

----------

## batistuta

Thanks madchaz for your suggestion, but I'm still a bit confused what you mean. You say to use an SSH session and then talk about VNC, I'm not sure I understand, but I'm interested in your suggestion.

Good to know about potential locking problems. I've thought this shouldn't be an issue though  :Rolling Eyes: 

I will keep it in mind in case something looks strange

----------

## rush_ad

not sure if this question belongs here

is there any way to access my gentoo box from windows xp's remote desktop connection client? i have enabled remote connections from my gnome 2.12

----------

## madchaz

rush_ad, that should be a dif post, but to awnser your question, no. Remote desktop is to connect to a windows box. Best is to use vnc. 

batistuta: What you do to start a "virtual" session with vnc is type "vncserver" at the command line as the user you want to start the session for. For exemple, when I want to get my home desktop from work, I ssh into my box at home with my own username, type vncserver and close ssh when it's done running. Then, I use a vnc client (like tightvnc) to connect to the machine.

----------

## batistuta

 *madchaz wrote:*   

> What you do to start a "virtual" session with vnc is type "vncserver" at the command line as the user you want to start the session for

 

Ah! Now I got it   :Very Happy: 

Thanks again. I will try this as soon as my system finishes recompiling world with gcc4. Might take few more days, but I'll post results. Thanks!

----------

## rush_ad

 *madchaz wrote:*   

> rush_ad, that should be a dif post, but to awnser your question, no. Remote desktop is to connect to a windows box. Best is to use vnc. 
> 
> batistuta: What you do to start a "virtual" session with vnc is type "vncserver" at the command line as the user you want to start the session for. For exemple, when I want to get my home desktop from work, I ssh into my box at home with my own username, type vncserver and close ssh when it's done running. Then, I use a vnc client (like tightvnc) to connect to the machine.

 .

thanks.

vnc is a problem because not all windows machines (at least not at my college computer labs that i actually need to use) have vnc client installed. so i am just looking for something that does not need anything more than windows has to offer.

----------

## batistuta

After failing to emerge vnc (some compile errors), I finally got freenx working  :Very Happy: 

It was a fairly quick (the howto is outdated though). I have to say that it is very nice! Thanks for the people who suggested it.

----------

## madchaz

 *rush_ad wrote:*   

>  *madchaz wrote:*   rush_ad, that should be a dif post, but to awnser your question, no. Remote desktop is to connect to a windows box. Best is to use vnc. 
> 
> batistuta: What you do to start a "virtual" session with vnc is type "vncserver" at the command line as the user you want to start the session for. For exemple, when I want to get my home desktop from work, I ssh into my box at home with my own username, type vncserver and close ssh when it's done running. Then, I use a vnc client (like tightvnc) to connect to the machine. .
> 
> thanks.
> ...

 You can download the client and use it without even installing it. Just go to www.realvnc.com

It's a single .exe that does not require installation.

----------

## rush_ad

 *madchaz wrote:*   

>  *rush_ad wrote:*    *madchaz wrote:*   rush_ad, that should be a dif post, but to awnser your question, no. Remote desktop is to connect to a windows box. Best is to use vnc. 
> 
> batistuta: What you do to start a "virtual" session with vnc is type "vncserver" at the command line as the user you want to start the session for. For exemple, when I want to get my home desktop from work, I ssh into my box at home with my own username, type vncserver and close ssh when it's done running. Then, I use a vnc client (like tightvnc) to connect to the machine. .
> 
> thanks.
> ...

 

thanks. i am behind router, do i need to forward any ports?

also, i use gnome 2.12 which has a remote desktop function included. do you think if i enable that function, i can use realvnc client to connect to my computer?

----------

## rush_ad

figured out, needed to forward port 5900.

----------

## urcindalo

 *madchaz wrote:*   

> What you do to start a "virtual" session with vnc is type "vncserver" at the command line as the user you want to start the session for. For exemple, when I want to get my home desktop from work, I ssh into my box at home with my own username, type vncserver and close ssh when it's done running. Then, I use a vnc client (like tightvnc) to connect to the machine.

 

Thanks. I followed your instructions and was able to get an X session appear in my local machine (albiet using the ugly twm until I configure it   :Rolling Eyes:  )

My question is: how can I close it after having used it? I mean,  what I did was:

1) Connect to the remote computer through ssh

2) type vncserver

3) close ssh connection

4) Using a VNC client, I connected to the remote.machine:1 port (remote.machine:0 is the currently running X session on the remote machine).

5) When I close the VNC client, open it again and try to connect to the previous virtual X session, it is stil lthere!!!

So, I'd like to stop the virtual VNC session on remote.machine:1 once I'm done with it. How can I do that?

I want my virtual session to be "disposable" after having used it.

----------

## gpstefansson

 *urcindalo wrote:*   

> So, I'd like to stop the virtual VNC session on remote.machine:1 once I'm done with it. How can I do that?
> 
> I want my virtual session to be "disposable" after having used it.

 

You can ssh back into the server and issue the following command to kill the vncserver:

```
vncserver -kill :display# 
```

 Where "display# is the number of the display issued by your original vncserver command. In your case, probably 1. 

Hope this helps...

----------

## urcindalo

Thanks for your kind help, gpstefansson.

Although I found out that for myself your explanation will be really useful for future reference (BTW, I should have posted it once I learnt how to achieve it   :Embarassed:   :Embarassed:  )

----------

