5

I'm trying to set up a few VMs of ubuntu on my windows 7 machine. I need the machines to be able to ping each other and I would like to assign them a FQDN.

The purpose of this project is to set up a hadoop cluster. I'm following the instructions here.

The fully qualified domain name (FQDN) for each host in your system, and which component(s) you wish to set up on which host. The Ambari install wizard does not support using IP addresses. You can use hostname -f to check for the FQDN if you do not know it.

I've edited /etc/hosts :

127.0.0.1 localhost
10.0.0.1 base.localdomain base

How can I assign FQDN to each VM, and make sure the machines can see each other? I'm using virtualbox.

I do not have DNS. My VirtualBox is set up as NAT and all defaults.

  • 1
    This is partly a Windows and VirtualBox networking specific question. I'm not sure whether Ask Ubuntu is the right place for this. Either way - VirtualBox offers many different type of virtual networking. Please include your current configuration in your question to start with. Also: do you have a central DNS server running? Or do you want to set it up in /etc/hosts files on each and every machine? – gertvdijk Jun 17 '13 at 22:44
  • @qert thanks so much for your response. i dont have dns and not planning to get one. the virtualbox is all defaults NAT. i plan to do etc/hosts on every machine – l--''''''---------'''''''''''' Jun 17 '13 at 22:54
  • @qertvdijk is there any other info that i can provide to you that could be useful? – l--''''''---------'''''''''''' Jun 17 '13 at 23:08
  • I could answer your question perfectly fine if I would have a Windows PC here (that's why this is the wrong site to ask). NAT networking in VirtualBox is isolated connectivity to the outside world - you'd probably want to add a network of the other types. – gertvdijk Jun 17 '13 at 23:12
  • In NAT mode, the virtual machine can ping the host at 10.0.2.2, but AFAIK the host cannot ping the vm. – ignis Jun 18 '13 at 8:32
10

Change NAT to Internal Network :

  • Select your VM
  • then press Setting
  • then Network.

Now you can see adapter attached to your VMs , to make all machine able to ping each other select Internal Network, that make a connection between all VMs , to ping the computer host select Bridge Adapter , then select the interface.

2

In case some people are interested in VirtualBox, and this is what I think:

VBoxManage.exe modifyvm vm-name --memory 1024 --nic1 nat --nic2 hostonly --hostonlyadapter2 "VirtualBox Host-Only Ethernet Adapter"

nic1 with nat is for Internet access; nic2 with hostonly is for host access; check virtual machine host name in /etc/sysconfig/network or using hostnamectl set-hostname host-name and file:

/etc/sysconfig/network-scripts/ifcfg-[interface]
DEVICE=interface
HWADDR=some string...
TYPE=Ethernet
UUID=0e5413f5-asdf-40e1-b0fb-asdfasdfasdfasdf
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.57.104
NETMASK=255.255.255.0

I configured virtual machine using virtualbox command tool, but from time to time, the generated files are corrupted, so I have to fix above files manually.

Then in the host: ensure the nic with a name "VirtualBox Host-Only Network" is configured in the same network (IP4: 192.168.57.1, NETMASK=255.255.255.0). And that "VirtualBox Host-Only Network" is created when install VirtualBox (or is it?).

please correct this if any flaw.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.