1

I can't use localhost because from my virtual machine's perspective localhost is the virtual machine itself and not the underlying host that it is running on. How can I connect to the host machine from the virtual machine?

I tried this answer to a related question: https://superuser.com/a/310745/157900 but I can't decipher the output from netstat -rn. My output looks like:

$ netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            172.28.0.1         UGSc           34        0     en0
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH             23   636160     lo0
169.254            link#4             UCS             0        0     en0
172.28/24          link#4             UCS            20        0     en0
172.28.0.1/32      link#4             UCS             1        0     en0
172.28.0.1         0:14:a9:69:86:d9   UHLWIir        36       24     en0   1190
172.28.0.31        a4:4e:31:19:89:58  UHLWI           0        3     en0   1088
172.28.0.32        74:e5:43:6:1e:f7   UHLWI           0        8     en0   1040
172.28.0.47        f0:db:e2:e5:f1:ad  UHLWI           0        0     en0   1142
172.28.0.57        78:3a:84:a:c3:2b   UHLWI           0        0     en0    701
172.28.0.63        88:1f:a1:2:fc:16   UHLWI           0        0     en0   1200
172.28.0.66        78:31:c1:be:da:46  UHLWI           0        0     en0   1148
172.28.0.70        64:76:ba:8d:b1:32  UHLWI           0        0     en0    854
172.28.0.73        78:31:c1:bb:7:3e   UHLWI           0        0     en0    995
172.28.0.83/32     link#4             UCS             0        0     en0
172.28.0.90        2c:d0:5a:44:b0:6d  UHLWI           0       14     en0   1166
172.28.0.97        30:59:b7:10:5f:ea  UHLWIi          1        1     en0   1175
172.28.0.133       70:56:81:b9:b:3f   UHLWI           0        0     en0   1095
172.28.0.137       a4:4e:31:1c:92:4c  UHLWI           0        6     en0    976
172.28.0.138       90:72:40:90:57:b6  UHLWI           0        0     en0    963
172.28.0.152       b8:e8:56:10:bb:16  UHLWIi          1        0     en0   1106
172.28.0.157       a4:4e:31:1b:98:14  UHLWI           0       50     en0   1089
172.28.0.167       7c:d1:c3:e0:9d:77  UHLWI           0        0     en0    521
172.28.0.175       68:96:7b:49:c7:89  UHLWI           0        0     en0    456
172.28.0.212       18:f6:43:4a:ee:8f  UHLWI           0        0     en0     21
172.28.0.229       7c:e9:d3:f6:3f:c8  UHLWI           0       51     en0   1136
172.28.0.255       ff:ff:ff:ff:ff:ff  UHLWbI          0        1     en0
192.168.33         link#11            UC              2        0 vboxnet
192.168.33.1       a:0:27:0:0:1       UHLWIi          1       62     lo0
192.168.33.255     ff:ff:ff:ff:ff:ff  UHLWbI          0        1 vboxnet

Internet6:
Destination                             Gateway                         Flags         Netif Expire
::1                                     ::1                             UHL             lo0
fe80::%lo0/64                           fe80::1%lo0                     UcI             lo0
fe80::1%lo0                             link#1                          UHLI            lo0
fe80::%en0/64                           link#4                          UCI             en0
fe80::1c5a:b8ac:59f0:4078%en0           7c:d1:c3:15:1a:ab               UHLWI           en0
fe80::3e15:c2ff:fec3:ecc4%en0           3c:15:c2:c3:ec:c4               UHLI            lo0
fe80::%awdl0/64                         link#8                          UCI           awdl0
fe80::444e:b5ff:fe10:887a%awdl0         46:4e:b5:10:88:7a               UHLI            lo0
ff01::%lo0/32                           ::1                             UmCI            lo0
ff01::%en0/32                           link#4                          UmCI            en0
ff01::%awdl0/32                         link#8                          UmCI          awdl0
ff02::%lo0/32                           ::1                             UmCI            lo0
ff02::%en0/32                           link#4                          UmCI            en0
ff02::%awdl0/32                         link#8                          UmCI          awdl0

The above is mostly meaningless to me, although it looks like something is going on in the 192.168.33 space.

netstat -rn | grep "^0.0.0.0" returns no results.

Also, is there any reason I should be concerned about posting the above info publicly?

Thanks.

1

From the network perspective the host machine and virtual box still carry a different LAN IPs. You can connect with those IP addresses

2
  • Sounds good, but trying to connect to mongo on my Mac from the VM results in a time-out problem when I try this.
    – jononomo
    Jan 23 '15 at 20:58
  • Were you able to ping the IP and see if any user firewall is running on the VM?
    – J Bourne
    Jan 24 '15 at 8:18

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.