Let's say there is a host OS (Mac OS X) and a virtual machine running Ubuntu as guest OS. The guest OS has the IP 192.186.56.101 and some virtual hosts, e.g. ubuntu.server
So, how to really map a request to the virtual host ubuntu.server on the guest OS?
I tried:
Configure the host OS in /etc/hosts to map ubuntu.server to 192.186.56.101 On the guest OS we have the trouble. It accepts the request for 192.186.56.101 which is not ubuntu.server and therefor the ubuntu.server virtual host will never be requested. Just the localhost on the guest OS. It might surely be possible to simply then use 192.168.56.101. But this would only work for one host per guest OS.
Any idea? Or is there a bug in my train of thoughts?
-
Is the VM using bridged networking?
Did you establish that the VM guest is seeing the network properly, and that hosts outside on the network can connect to the guest VM (ping, ssh, etc.)?
Once you do that, then you should be able to configure virtual IP's and such to the guest.
Bart Silverstrim : You'll probably want it bridged. NAT, especially in Virtualbox, I've found to be problematic with getting connections from physical to virtual systems to work well. It involves a lot of hoop-jumping and getting virtual IP's to work? I'd never even try it.From Bart Silverstrim -
You have to configure the network that the guests connect to as a "bridged" network. This will give them direct access to the network that the host is connected to. It will also permit the network direct access to the guests as if they were real hosts.
Note that this means that either you have to have valid network IP addresses to assign to your guests, or that the network in question is able and willing to hand out valid DHCP leases to your guests.
Alternatively you may be able to set up a route between your guests on the "host-only" network and your real network. But this will be more work, and at the very least the router on your network will probably be required to know about your private "host-only" network IP space and the fact that it is reachable through your host.
Bridged networking is the simplest to set up and use.
Bart Silverstrim : With Virtualbox I think there are additional steps involved to get it's NAT'ed IP to allow incoming connections. Not fun or easy.Bart Silverstrim : Which I know is why you said to add bridged networking (I just hadn't thought to mention it) but I think the poster was using NAT with Virtualbox at the moment. Personally for playing with server stuff I'd recommend considering VMWare or something else...I've found VirBox to be great for workstation VM's, but not server tasks. Just my opinion, though.David Mackintosh : I don't think you could add external access to the NAT network because even if packets were routed in, the replies would get NAT'd back out and the connection wouldn't work. You might be able to port-forward certain ports back into the guests, but it would be fiddly to get right. (I agree that VMware Server is a better option for VMs that are going to be actual services.)From David Mackintosh -
Gotta use bridge networking instead of NAT (Uses same connection/ip as the host computer is)
Are you using Parallels/VMWare/Virtual Box?
They all have options for bridged.
From EpicDewd
0 comments:
Post a Comment