Page 1 of 1

headless debian - networkin doubts

Posted: 31. May 2009, 15:02
by marmellata
Hello, it is the first time I use VB. I installed VB on my headless Debian Lenny:
VBoxManage createvm -name "server2" -register
VBoxManage modifyvm "server2" -memory "256MB" -acpi on -boot1 dvd -nic1 nat
VBoxManage createvdi -filename "server2.vdi" -size 20000 -register
VBoxManage modifyvm "server2" -hda "server2.vdi"
VBoxManage registerimage dvd /root/debian-501-i386-netinst.iso
VBoxManage modifyvm "server2" -dvd /root/debian-501-i386-netinst.iso

Ihave 2 networking problems:

My guest server is in a different subnet then my host server. why? do I have to change nat to bridge?

I have 2 FE interfaces on my server: host server has eth0, can I make the guest server using eth1 instead of eth0? .. then is it possible do give guest server 2 interfaces?

thanks

Re: headless debian - networkin doubts

Posted: 31. May 2009, 15:19
by Sasquatch
The subnet is due to the NAT setting.

You can use two NICs in a VM. For your bridged question, is eth1 active and connected? If it doesn't have a cable attached to it, you can just as well set the VM to use a Not Attached NIC, as it won't work. No cable = no connection.

Re: headless debian - networkin doubts

Posted: 31. May 2009, 15:50
by marmellata
first thanks for your answer. the first problem now is: host has eth0, guest uses the same interface. how can i make it using bridged instead of nat? I tried
VBoxManage modifyvm "server2" -memory "256MB" -acpi on -boot1 dvd -nic1 bridged
bt it says error: Invalid type 'bridged' specfied for NIC 1. So I tried hostif but when I start VM I get
Error: failed to start machine. Error message: Failed to initialize Host Interface Networking.
VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED)

Re: headless debian - networkin doubts

Posted: 31. May 2009, 15:58
by marmellata
Name: server2
Guest OS: Other/Unknown
UUID: 4fd67376-5fad-4024-b55a-cbe6badbae78
Config file: /root/.VirtualBox/Machines/server2/server2.xml
Memory size: 256MB
VRAM size: 8MB
Boot menu mode: message and menu
ACPI: on
IOAPIC: off
PAE: off
Time offset: 0 ms
Hardw. virt.ext: off
Nested Paging: off
State: powered off (since 2009-05-31T13:48:36.000000000)
Monitor count: 1
Floppy: empty
SATA: disabled
Primary master: /root/.VirtualBox/VDI/server2.vdi (UUID: 5be3ee44-9b95-4dbf-a1d2-9de8481a3ded)
DVD: /root/debian-501-i386-netinst.iso (UUID: af4a12c4-95e9-4222-83f1-6675990aa722)
NIC 1: MAC: 080027269F11, Attachment: Host Interface 'eth0', Cable connected: on, Trace: off (file: none), Type: Am79C973, Reported speed: 0 Mbps
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
UART 1: disabled
UART 2: disabled
Audio: disabled (Driver: Unknown, Controller: Unknown)
Clipboard Mode: Bidirectional
VRDP: disabled
USB: disabled

Re: headless debian - networkin doubts

Posted: 31. May 2009, 18:01
by marmellata
no tutorial nowhere to setup networking for host and guest server in bridge mode :(

Re: headless debian - networkin doubts

Posted: 31. May 2009, 18:39
by Sasquatch
There is help output if you read the Manual, or just run VBoxManage without arguments. You need to provide a name for the interface along with the attached method.

Code: Select all

VBoxManage modifyvm <vmname> --bridgeadapter<1-N> none|<devicename>
Would become:

Code: Select all

VBoxManage modifyvm debian --nic1 bridged --bridgeadapter1 eth0

Re: headless debian - networkin doubts

Posted: 31. May 2009, 22:40
by marmellata
VBoxManage modifyvm "server2" -nic1 hostif -hostifdev eth0
VirtualBox Command Line Management Interface Version 2.0.8
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

error: Invalid NIC number ''

Re: headless debian - networkin doubts

Posted: 31. May 2009, 23:52
by Sasquatch
Hmm, since you use 2.0.8, and I use 2.2.4, there are differences in the command. As I said, check it all by running VBoxManage without arguments. You can get a little more specific help if you enter only one argument, like VBoxManage modifyvm.
And one other thing: Direct NIC access is available since 2.1.0, so your version still requires a virtual NIC to be created and bridged to your physical NIC with bridge-utils. It's best to upgrade to 2.1.4 or 2.2.4 for the new feature if you don't want or know how to create a bridge.

Re: headless debian - networkin doubts

Posted: 1. Jun 2009, 18:53
by marmellata
I reinstalled VB 2.2.4 and now it should work, I'm intsalling the guest server.. :)