Virtual Network within Virtual Box

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
dba_mountaineer
Posts: 5
Joined: 14. Jul 2010, 08:24
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: OpenSolaris, Windows 7, Oracle Linux, Ubuntu, Sun Solaris

Virtual Network within Virtual Box

Post by dba_mountaineer »

Hi,

Just like to inquire, is it possible to see each virtual hostname in virtualbox?

Example scenario:
Guest OS 1: OpenSolaris (lets say hostname = Solaris1)
Guest OS 2: OpenSolaris (lest say hostname = Solaris2)

If both guest OS are running in my virtualbox, I logged in Solaris1, will I be able to connect like ssh or rsh in Solaris2 ? like Virtual network? because I am planning to create RAC Database lab just within Virtual box that I have in my laptop but I am not sure if I this is possible.

The one that I just tried so far is the scenario below:
Guest OS 1: OpenSolaris (opensolaris actually installed)
Guest OS 2 : OpenSolaris (just boot in virtual cd rom/dvd, with the iso format which just downloaded - opensolaris not yet installed)

then I tried to ping one the hostname and the output is "alive" but I tried to ssh one of the hostname and the output is connection refused.

do i need to do something? setup something? Any help is really appreciated. Thanks in advance

note: backgroup setup of my virtualbox installed in my laptop with MAC OS - Snow Leopard
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, OSX
Location: U S of A

Re: Virtual Network within Virtual Box

Post by ChipMcK »

dba_mountaineer
Posts: 5
Joined: 14. Jul 2010, 08:24
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: OpenSolaris, Windows 7, Oracle Linux, Ubuntu, Sun Solaris

Re: Virtual Network within Virtual Box

Post by dba_mountaineer »

Hi, its me again,

I started to review manuals for networking in VirtualBox and started to test by following the instructions from it.

Current situation:

i setup a guest os which is ubuntu (quite old version - just from my old cd installer from the book I bought) and the version is below:

me@ubuntu:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=6.10
DISTRIB_CODENAME=edgy
DISTRIB_DESCRIPTION="Ubuntu 6.10"

me@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 6.10
Release: 6.10
Codename: edgy

ubuntu seems to installed fine and i was able to use it, i can connect to internet

My VirtualBox set in Adapter1 is NAT, Adapter Type set as Intel PRO/1000 MT Desktop (82540EM)

I am trying to test what had been indicated in the manual so my starting point is NAT to understand more about so called network or virtual network (i am not really good at it - so spare me for this)

I am reading the manual for Configuring port forwarding with NAT and tried to follow the execution of the command below:

VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,,2222,,22"

Then at initial execution I already encountered error such as below:

myserver:~ me$ VBoxManage modifyvm "Ubuntu" --natpf1 "guestssh,tcp,,2222,22"
Oracle VM VirtualBox Command Line Management Interface Version 3.2.6
(C) 2005-2010 Oracle Corporation
All rights reserved.

ERROR: A session for the machine 'Ubuntu' is currently open (or being closed)
Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports
Context: "OpenSession(a->session, machineuuid)" at line 314 of file VBoxManageModifyVM.cpp


Then, I google again if there are similar error that had been encountered and whats possible solutions:
My search led me to read the ticket related to this http://www.virtualbox.org/ticket/443 - "Some situations make VirtualBox think a session on a powered-off vm is being openned/closed and a full system restart is required"

so i checked the VBoxSVC

myserver:~ me$ ps -ef|grep VBoxSVC
501 59419 1 0 1:18.79 ?? 1:46.12 /Applications/VirtualBox.app/Contents/MacOS/VBoxSVC --pipe 9 --auto-shutdown
501 36930 61360 0 0:00.00 ttys000 0:00.00 grep VBoxSVC

then I decided to shutdown the Ubuntu guest os and kill the process

then, i restart VirtualBox, then start Ubuntu again, then tried to run the command again but encounters the same issue.

myserver:~ me$ VBoxManage modifyvm "Ubuntu" --natpf1 "guestssh,tcp,,2222,22"
Oracle VM VirtualBox Command Line Management Interface Version 3.2.6
(C) 2005-2010 Oracle Corporation
All rights reserved.

ERROR: A session for the machine 'Ubuntu' is currently open (or being closed)
Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports
Context: "OpenSession(a->session, machineuuid)" at line 314 of file VBoxManageModifyVM.cpp



Can someone help me how I will fix this?

Thanks again for the help.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, OSX
Location: U S of A

Re: Virtual Network within Virtual Box

Post by ChipMcK »

Why not use Settings when VBox is started?
These will be less angst with the GUI.
Also, read the topics above - save time and effort
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Virtual Network within Virtual Box

Post by Sasquatch »

NAT rules can only be applied when the VM is turned OFF. Connecting through SSH only works if the server is installed (openssh-server). Plenty of information, read up on it first, then ask questions. Most of your questions are already answered in the previously linked topics and in the manual.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Re: Virtual Network within Virtual Box

Post by Technologov »

VBox GUI->VM->Settings->Network->

change "NAT" option into either "Bridge" mode or to "Internal".

See docs chapter "6.2. Introduction to networking modes".
dba_mountaineer
Posts: 5
Joined: 14. Jul 2010, 08:24
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: OpenSolaris, Windows 7, Oracle Linux, Ubuntu, Sun Solaris

Re: Virtual Network within Virtual Box

Post by dba_mountaineer »

Thanks for replies, just followed instructions and read manual.

while exploring both google, forum and manual, just figured out how I am going to use it.

Here's my notes although i am still experimenting stuff.

I use NAT if I want to inherit the internet connection of the my host and its really working great.
I use bridge adapter if i want to use internal networking within all my virtualbox machines (as similar to public network - just configuring hosts files since i don't have virtual dns server yet --> plan to experiment it soon) and its working too
I use host adapter for some experimental private networking like virtual servers connecting to virtual storage.

There are lots of stuff to experiment...(right now i am working on how i add disk aside from vdi that i am using in my virtual machine like in real world, disk mounted are all full and you want to extend or add more :D )

my virtual lab is in progress...
Post Reply