Accessing website on Ubuntu guest, OS X Host

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
ome bos
Posts: 8
Joined: 22. Nov 2008, 12:23

Accessing website on Ubuntu guest, OS X Host

Post by ome bos »

As I pointed out in my previous Topic, http://forums.virtualbox.org/viewtopic.php?t=11624 , I'm having trouble accessing my Application Express page fromout my host environment.

The problem is, I think, more general than I pointed out earlier.

In the guest environment (Ubuntu 8.10) I can access the website as following:

http://localhost:9876/apex

In what way is it possible for me to access this site in a browser on my host environment? (Firefox in OS X 10.5.5).

Hope you guy's got some good tips!

Regards,

Douwe Pieter
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Post by baf »

If you're running nat which I suppose then you need to setup portforwarding with something like this:
VBoxManage setextradata "Win2k" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest7011/HostPort" 7011
VBoxManage setextradata "Win2k" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest7011/GuestPort" 7011
VBoxManage setextradata "Win2k" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guest7011/Protocol" TCP

Where Win2K is the name of your virtual machine.
guest7011 is a "tag" for this set of settings
7011 is the port you want to reach. It does not have to be the same on the inner and outer side.

Good Luck.
ome bos
Posts: 8
Joined: 22. Nov 2008, 12:23

Post by ome bos »

Great! It worked!

Your brillant! Thanks!
alecse
Posts: 2
Joined: 2. Dec 2008, 15:12

Is it related

Post by alecse »

Hi,

I'm a newbie and I'm not sure that my problem is related :
Here is the situation :

I have an iMac with OSX.5 (host)
and I'm running XP Pro SP2 as guest system using VirtualBox

I'm willing to have a local server running on DotNetNuke on the XP

I did all configuration steps and it should be working

But when I try to access my website (via http://localhost/angel or http://localhost:8080/angel), it doesn't work !!!

I think it might be related with some issues with the port 80 that is allready used by a device (which one, I don't know)

But I really don't know what to do.

The DNN setup (done online by a friend of mine through logmein) is ok.

So if someone can help me, that would be just so great !!!
jwickard
Posts: 4
Joined: 4. Dec 2008, 16:02

Trying to do the same thing, different problem

Post by jwickard »

When I try to enter the port forwarding commands, I get a different error:

Code: Select all

sudo VBoxManage setextradata "dev" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" TCP
I get:

Code: Select all

VirtualBox Command Line Management Interface Version 2.0.6
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling virtualBox->FindMachine(Bstr(argv[0]), machine.asOutParam()) at line 6979!
[!] Primary RC  = NS_ERROR_INVALID_ARG (0x80070057) - Invalid argument value
[!] Full error info present: true , basic error info present: true 
[!] Result Code = NS_ERROR_INVALID_ARG (0x80070057) - Invalid argument value
[!] Text        = Could not find a registered machine named 'dev'
[!] Component   = VirtualBox, Interface: IVirtualBox, {557a07bc-e6ae-4520-a361-4a8493199137}
[!] Callee      = IVirtualBox, {557a07bc-e6ae-4520-a361-4a8493199137}
The machine is definitely named dev however. From dev.log:

Code: Select all

00:00:00.687   Name               <string>  = "dev" (cch=4)
Anyone have any insight?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Make sure that your parameters are in HostPort, GuestPort, Protocol order.

Try using the UUID instead of the VM name, just in case you've managed to get spaces in your VM name.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
jwickard
Posts: 4
Joined: 4. Dec 2008, 16:02

Post by jwickard »

I tried using the uuid, no change just gave the same message, but instead said that it could find a host by the name of that uuid.
jwickard
Posts: 4
Joined: 4. Dec 2008, 16:02

SUCCESS... well... almost

Post by jwickard »

So I did a VBoxManage list vms and realized that it couldn't find a registered machine if I use sudo to issue the command.

The problem is, when I don't use sudo, the settings don't seem to take. I can issue all the same commands above, I get no errors, but if I open the settings.xml file, there are no entries for the properties I'm setting via setextradata
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

I just realised that you are doing sudo ... Why? This means that you are attempting to set parameters of a VM owned by root, rather than your logged on User ID.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
jwickard
Posts: 4
Joined: 4. Dec 2008, 16:02

Post by jwickard »

Yeah I figured that out too, however now the commands don't seem to take at all and there are no entries being created in my settings.xml file any longer
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

If the commands "work" then you can check that they are being correctly loaded by viewing the log file (Ctl-L with focus on the VM in the GUI). The ** CFGM Dump ** enumerates the configuration; look for the pcnet/0 tree.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
billspat
Posts: 1
Joined: 18. Dec 2008, 17:06

Post by billspat »

jwickard - This is an under-educated long shot, but have you tried naming the VM something other than 'dev' ? duplicating the disk and making a new VM is low cost to troubleshoot.

VBoxManage modifyvm <uuid> -name development

dev is all over the place in *nix and the shell. This might also explain why sometimes it works using sudo. Even though you've tried the uiud, could be some edge-case that vboxmanage coders haven't tested against.

I'm not a unix expert by any means but have seen other problems like this on Mac, linux and windows. for example, in windows XP, any file named COMx.something.something can't be clicked on, copied, viewed, renmaed, etc. (where x is any single digit).

HTH
ome bos
Posts: 8
Joined: 22. Nov 2008, 12:23

Re: Accessing website on Ubuntu guest, OS X Host

Post by ome bos »

Hi there guy's

I got a new one, same topic...

I created a brand new VirtualBox (version 3.2.4) instance with Ubuntu 10.04. This time I got the same stuff on it: an Oracle XE Database with Oracle Application Express. I tried to connect using the same commands:

VBoxManage setextradata “Ubuntu” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/apex/Protocol” TCP

and

VBoxManage setextradata “Ubuntu” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/apex/HostPort” 9876

and

VBoxManage setextradata “Ubuntu” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/apex/GuestPort” 9876

When I navigate to http://127.0.0.1:9876/apex on the guest (Ubuntu) machine, I get the APEX login page, but when I do this on my Mac, I cannot find the page...

Is this protocol changed in the recent versions of VirtualBox? Or did I do something wrong?
ome bos
Posts: 8
Joined: 22. Nov 2008, 12:23

Re: Accessing website on Ubuntu guest, OS X Host

Post by ome bos »

I think I got something. I probably missplaced the qoutes (i.e. falsely copy - pasted them, silly me)

But now a new problem occurs: I can't seem to start my machine anymore.

Here's the topic I found with google:

http://forums.virtualbox.org/viewtopic.php?f=7&t=29153
vodoomoth
Posts: 4
Joined: 4. May 2010, 12:38
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

Re: Accessing website on Ubuntu guest, OS X Host

Post by vodoomoth »

ome bos wrote:When I navigate to http://127.0.0.1:9876/apex on the guest (Ubuntu) machine, I get the APEX login page, but when I do this on my Mac, I cannot find the page...
Do you also use 127.0.0.1 on the Mac when you enter the address? If so, it explains the problem. If not, what address do you use when you try to access the login page that's running in the guest?
Post Reply