unable to ping guest ip on host


I am beginner of ubuntu, and i have installed ubuntu 16.04 on my desktop computer, then installed Vagrant by following steps

sudo apt-get install virtualbox
sudo apt-get install vagrant
vagrant box add ubuntu/xenial64
vagrant init ubuntu/xenial64
vagrant up
vagrant ssh

and I can access it:

vagrant@ubuntu-xenial:~$ ifconfig

enp0s3    Link encap:Ethernet  HWaddr 02:ba:5f:3b:91:b0

           inet addr:  Bcast:  Mask:
           inet6 addr: fe80::ba:5fff:fe3b:91b0/64 Scope:Link
           RX packets:282 errors:0 dropped:0 overruns:0 frame:0
           TX packets:201 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000 
           RX bytes:31982 (31.9 KB)  TX bytes:30222 (30.2 KB)

 lo        Link encap:Local Loopback  

           inet addr:  Mask:
           inet6 addr: ::1/128 Scope:Host
           UP LOOPBACK RUNNING  MTU:65536  Metric:1
           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1 
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

so i am trying to ping on host to but...

admin@admin-desktop:~$ ping

PING ( 56(84) bytes of data.

nothing happens.

ip route output on guest

 vagrant@ubuntu-xenial:~$ ip route
 default via dev enp0s3 dev enp0s3  proto kernel  scope link  src 

ip route output on host

 admin@admin-desktop:~$ ip route
 default via dev enp3s0  proto static  metric 100 dev enp3s0  scope link  metric 1000 dev enp3s0  proto kernel  scope link  src  metric 100 

i tried to set up NAT to Bridge adaptar shows below error

admin@admin-desktop:~$ vagrant reload
==> default: Attempting graceful shutdown of VM...
default: Guest communication could not be established! This is usually because
default: SSH is not running, the authentication information was changed,
default: or some other networking issue. Vagrant will force halt, if
default: capable.
==> default: Forcing shutdown of VM...
==> default: Checking if box 'ubuntu/xenial64' is up to date...
==> default: A newer version of the box 'ubuntu/xenial64' is available! You currently
==> default: have version '20191108.0.0'. The latest is version '20191113.0.0'. Run
==> default: `vagrant box update` to update.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "49520cee-d0ee-43e3-869c-4f78e1fb9dfd", "--natpf1", "ssh,tcp,,2222,,22"]

Stderr: VBoxManage: error: A NAT rule of this name already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component NATEngineWrap, interface INATEngine, callee nsISupports
VBoxManage: error: Context: "AddRedirect(Bstr(strName).raw(), proto, Bstr(strHostIp).raw(), RTStrToUInt16(strHostPort), Bstr(strGuestIp).raw(), RTStrToUInt16(strGuestPort))" at line 1838 of file VBoxManageModifyVM.cpp
enter code here
asked on Stack Overflow Nov 13, 2019 by Pundlik Patil

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0