public_network wrongly generated box from ubuntu based iso?

33 views
Skip to first unread message

peter....@gmail.com

unread,
Aug 11, 2016, 6:54:47 AM8/11/16
to Vagrant
Hello all,

i'm trying to define bridged interface on my box generated from ubuntu based iso.

box.vm.network :public_network, bridge: 'eth0', ip: 'xx.xx.xx.xx', netmask: '255.255.255.192'

But it does not set my eth1 interface on the box. No error in the output.
Can the reason be that when opening vm in virtualbox, from which i generated the box, does not have adapter 2 enabled nd configured?

Note: I have tried the above setting for a new box for trusty64 box dowloaded from web - and it is working.

Thanks for the help in advance.
Kind regards,
Ardi

Alvaro Miranda Aguilera

unread,
Aug 12, 2016, 3:47:25 AM8/12/16
to vagra...@googlegroups.com

On the guest, can you do vagrant reload, then whats the output of ifconfig -a ?

what os is your host?

if linux/osx share ifconfig -a
if windows ipconfig /all

Thanks
Alvaro


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/507a549e-8a83-4aad-bbfe-3f915cddfa82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

peter....@gmail.com

unread,
Aug 15, 2016, 3:00:46 AM8/15/16
to Vagrant
Hello Alvaro,

a)
when doing 'vagrant reload', I have encountered another error:

Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attemped was:

set -e
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

As far as I know, i have installed correctly GuestAdditions on the initial vm (from which I generated later the xxx.box) using the following steps:

wget http://download.virtualbox.org/virtualbox/4.3.36/VBoxGuestAdditions_4.3.36.iso
sudo mkdir /media/VBoxGuestAdditions
sudo mount -o loop,ro VBoxGuestAdditions_4.3.36.iso /media/VBoxGuestAdditions
sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
rm VBoxGuestAdditions_4.3.36.iso
sudo umount /media/VBoxGuestAdditions
sudo rmdir /media/VBoxGuestAdditions

b)
When i do 'vagrant ssh' to the box, xx.xx.xx.xx appears correctly for eth1 on box.
I can even ping xx.xx.xx.aa which is default gateway on host.

on box:
======
$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr aa:aa:aa:aa:aa:df
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:512 errors:0 dropped:0 overruns:0 frame:0
          TX packets:310 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:50739 (50.7 KB)  TX bytes:40535 (40.5 KB)

eth1      Link encap:Ethernet  HWaddr bb:bb:bb:bb:bb::9e
          inet addr:xx.xx.xx.xx  Bcast:10.253.61.127  Mask:255.255.255.192 <==============OK
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:244 errors:0 dropped:0 overruns:0 frame:0
          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22784 (22.7 KB)  TX bytes:4276 (4.2 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1484 (1.4 KB)  TX bytes:1484 (1.4 KB)

vagrant@box:~$ ping xx.xx.xx.aa
PING xx.xx.xx.aa (xx.xx.xx.aa) 56(84) bytes of data.
64 bytes from xx.xx.xx.aa: icmp_seq=1 ttl=255 time=0.359 ms
64 bytes from xx.xx.xx.aa: icmp_seq=2 ttl=255 time=0.326 ms
^C
--- xx.xx.xx.aa ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.326/0.342/0.359/0.024 ms
vagrant@box:~$


OS on host:
=========

# uname -a
Linux server 3.13.0-85-generic #129-Ubuntu SMP Thu Mar 17 20:50:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/debian_version
jessie/sid

OS on guest box:
=============
 uname -a
Linux box 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
vagrant@box:~$ cat /etc/debian_version
jessie/sid
vagrant@box:~$

Kind regards,
Ardi



On Friday, 12 August 2016 09:47:25 UTC+2, Alvaro Miranda Aguilera wrote:

On the guest, can you do vagrant reload, then whats the output of ifconfig -a ?

what os is your host?

if linux/osx share ifconfig -a
if windows ipconfig /all

Thanks
Alvaro

On Thu, Aug 11, 2016 at 12:54 PM, <peter....@gmail.com> wrote:
Hello all,

i'm trying to define bridged interface on my box generated from ubuntu based iso.

box.vm.network :public_network, bridge: 'eth0', ip: 'xx.xx.xx.xx', netmask: '255.255.255.192'

But it does not set my eth1 interface on the box. No error in the output.
Can the reason be that when opening vm in virtualbox, from which i generated the box, does not have adapter 2 enabled nd configured?

Note: I have tried the above setting for a new box for trusty64 box dowloaded from web - and it is working.

Thanks for the help in advance.
Kind regards,
Ardi

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--

peter....@gmail.com

unread,
Aug 15, 2016, 4:10:12 AM8/15/16
to Vagrant
Update: When i exited from box, did vagrant halt and vagrant up, all seems to be ok.
no error and ip xx.xx.xx.xx on eth1 is working.
Thanks for great hint.

Ardi

Alvaro Miranda Aguilera

unread,
Aug 15, 2016, 4:33:27 PM8/15/16
to vagra...@googlegroups.com
hello, for 1, if you are updating kernel, after that do a reboot, and then reinstall/install/compile the virtualbox modules.

for 2, vagrant is confikguring eth1 properly. by default eth0 will be nat and will have the default GW so the VM can have internet access

if you want to override the GW using the GW in the network you have in eth1, then check the documentation for a sample script:


check the very end of the page.

Alvaro.

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c2a0bd92-c4c0-47b6-b840-367eb80c3e9d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages