headless debian - networkin doubts

Discussions related to using VirtualBox on Linux hosts.
Post Reply
marmellata
Posts: 16
Joined: 31. May 2009, 14:50
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Debian

headless debian - networkin doubts

Post 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
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: headless debian - networkin doubts

Post 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.
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.
marmellata
Posts: 16
Joined: 31. May 2009, 14:50
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Debian

Re: headless debian - networkin doubts

Post 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)
marmellata
Posts: 16
Joined: 31. May 2009, 14:50
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Debian

Re: headless debian - networkin doubts

Post 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
marmellata
Posts: 16
Joined: 31. May 2009, 14:50
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Debian

Re: headless debian - networkin doubts

Post by marmellata »

no tutorial nowhere to setup networking for host and guest server in bridge mode :(
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: headless debian - networkin doubts

Post 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
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.
marmellata
Posts: 16
Joined: 31. May 2009, 14:50
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Debian

Re: headless debian - networkin doubts

Post 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 ''
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: headless debian - networkin doubts

Post 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.
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.
marmellata
Posts: 16
Joined: 31. May 2009, 14:50
Primary OS: Debian Lenny
VBox Version: OSE Debian
Guest OSses: Debian

Re: headless debian - networkin doubts

Post by marmellata »

I reinstalled VB 2.2.4 and now it should work, I'm intsalling the guest server.. :)
Post Reply