Control guest through VNC

Discussions about using Linux guests in VirtualBox.

Control guest through VNC

Postby Fabre » 11. Mar 2009, 02:29

I have been struggling with this for a couple of days now and after reading countless webpages on the subject, I still figure it out.

I am running a Linux guest (DSL) on a Windows XP host.

Guest 10.0.2.5
Host 192.168.10.15

The guest is running VNCserver and is able to connect to itself (vncviewer localhost:5901)

While I how to VNC to a machine on a same network, how do I connect to guest?

Is there a way of forwarding the port so 192.168.10:5901 will redirect to 10.0.2.5:5901?
Fabre
 
Posts: 2
Joined: 11. Mar 2009, 02:14

Re: Control guest through VNC

Postby Perryg » 11. Mar 2009, 03:25

Fabre wrote:I have been struggling with this for a couple of days now and after reading countless webpages on the subject, I still figure it out.

I am running a Linux guest (DSL) on a Windows XP host.

Guest 10.0.2.5
Host 192.168.10.15

The guest is running VNCserver and is able to connect to itself (vncviewer localhost:5901)

While I how to VNC to a machine on a same network, how do I connect to guest?

Is there a way of forwarding the port so 192.168.10:5901 will redirect to 10.0.2.5:5901?


Is there a reason why you have the guest at 10.0.2.5?

I would put it in the same address block as you host. Also you can stop the guest and go into the settings of VBox and set the network for hosted interface and relieve a lot of your problems.
Perryg
Site Moderator
 
Posts: 25923
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

Re: Control guest through VNC

Postby TerryE » 11. Mar 2009, 04:10

Simple. You're using NAT so you need the read the section of the manual on Port Forwarding. You set up a forward -- say from host:15901 to guest:5901. Now to VNC onto the guest's 5901 post, you connect to Host:15901. OK, this means that you aren't using the default port, but so what?

The alternative to use Host IF, which is just as easy. It doesn't need port forwarding, but the VM is now fully open to your LAN as another host.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
TerryE
Site Moderator
 
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS

Re: Control guest through VNC

Postby Fabre » 12. Mar 2009, 20:49

Thanks guys.

I set the network to use host IF and got the VNC working.
Now I just need to figure why I can't access my router ssh server from outside the LAN, but that's not related to Virtulbox.
Fabre
 
Posts: 2
Joined: 11. Mar 2009, 02:14

Re: Control guest through VNC

Postby jsh123 » 1. Apr 2009, 15:13

Just wondering how you got VNC to connect to the Guest. I am using the host if. I can http and ftp to the guest with the host if 192.168.1.104.

I can vnc from the guest to the guest 192.168.1.104:5903 so the server is running on the guest.

I can vnc from the guest 192.168.1.104 to the OpenSolaris host at 192.168.1.133:5900.

I can not vnc from the opensolaris host at 192.168.1.133 to the guest at 192.168.1.104:5903.

Thoughts?
jsh123
 
Posts: 22
Joined: 1. Apr 2009, 14:55
Primary OS: OpenSolaris 11
VBox Version: OSE Fedora
Guest OSses: Fedora & XP

Re: Control guest through VNC

Postby TerryE » 2. Apr 2009, 02:41

Have you checked the VNC config on the guest? By default it only allow connections from localhost.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
TerryE
Site Moderator
 
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS

Re: Control guest through VNC

Postby jsh123 » 2. Apr 2009, 23:00

The guest I am running is Fedora, which worked before I moved it to Virtual Box.

vnc.conf is not needed by fedora according to the article below.

http://www.g-loaded.eu/2005/11/10/confi ... in-fedora/

So I do not know where I would change it for the Fedora guest?
jsh123
 
Posts: 22
Joined: 1. Apr 2009, 14:55
Primary OS: OpenSolaris 11
VBox Version: OSE Fedora
Guest OSses: Fedora & XP

Re: Control guest through VNC

Postby TerryE » 3. Apr 2009, 01:12

Sorry, but I don't use Fedora. In Ubuntu, you simply configure VNC through the System -> Preferences -> Remote Desktop Preferences and enable VNC through the General tab. You can select whether to limit access to the localhost or not through the advanced tab. Does Fedora have a similar GUI configuration tool?

My only other suggestion would be to look at another stack as well such as SSH. That way you can work out whether this is a VNC specific issue or a VBox/Guest access one.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
TerryE
Site Moderator
 
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS

Re: Control guest through VNC

Postby jsh123 » 3. Apr 2009, 13:44

Yes, Fedora has the same GUI. It is under System/Preferences/Internet and Network/Remote Desktop. Currently set for allow users to view and allow users to control on the general tab. Advanced tab setting use port 5900 and no wallpaper.

I can connect to the VB Fedora guest with telnet, ssh, http, https, and ftp. so the network settings appear correct. just wondering how to see if it is OpenSolaris host or Fedora VNC that is messing up on the connection?
jsh123
 
Posts: 22
Joined: 1. Apr 2009, 14:55
Primary OS: OpenSolaris 11
VBox Version: OSE Fedora
Guest OSses: Fedora & XP

Re: Control guest through VNC

Postby TerryE » 3. Apr 2009, 17:02

Sorry but I am running out of ideas. Do you have an alternative PC to try connecting from?
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
TerryE
Site Moderator
 
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS

Re: Control guest through VNC

Postby Perryg » 3. Apr 2009, 18:05

jsh123 wrote:Yes, Fedora has the same GUI. It is under System/Preferences/Internet and Network/Remote Desktop. Currently set for allow users to view and allow users to control on the general tab. Advanced tab setting use port 5900 and no wallpaper.

I can connect to the VB Fedora guest with telnet, ssh, http, https, and ftp. so the network settings appear correct. just wondering how to see if it is OpenSolaris host or Fedora VNC that is messing up on the connection?


You might want to look at the firewall in fedora and make sure that the port is set to allow. By default it is not. (at least on my copy)
Perryg
Site Moderator
 
Posts: 25923
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

Re: Control guest through VNC

Postby jsh123 » 4. Apr 2009, 15:26

Weird, but that did it. system-config-firewall add ports.

I wonder why it is needed for a guest in virtualbox...

Thanks...
jsh123
 
Posts: 22
Joined: 1. Apr 2009, 14:55
Primary OS: OpenSolaris 11
VBox Version: OSE Fedora
Guest OSses: Fedora & XP

Re: Control guest through VNC

Postby Perryg » 4. Apr 2009, 15:39

jsh123 wrote:Weird, but that did it. system-config-firewall add ports.

I wonder why it is needed for a guest in virtualbox...

Thanks...


I am not really sure but when I was struggling with this it was stated that it had something to do with selinux and the way that fedora talked to it. (not sure I really believed it but...) As you said it was strange and I was a non-believer, but it worked. Go figure!
Perryg
Site Moderator
 
Posts: 25923
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

Re: Control guest through VNC

Postby viveky » 15. Jul 2009, 15:15

i dont know whether this thread has been closed or not. I have a solution for this. I will explain what i have done

I have navigated to the .vnc folder in the guest os (I am using the fedora core 1) and i have created a file with my vnc user name. There was a file called as localhost.localhost:1.pid which allows localhost to vnc. What I did was I have created a file with my user name called myname.myname:1.pid and changed the content of the file to 5901 for which i have configured the vnc.

Now when i try to connect to vnc using <IP of the guest os>:5901, it works :P

guess it helps
viveky
 
Posts: 6
Joined: 9. Mar 2009, 12:21


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 7 guests