OSX Tomcat access via VirtualBox Windows 7 - windows

I'm trying to access my Tomcat instance on OSX with Windows 7 via VirtualBox.
My network settings on VirtualBox:
Adapater 1: Bridged Adapter
Name: en1: Wi-Fi (Airport)
Adapter 2: Host-only Adapter
Name: vboxnet0
my ifconfig -a from OSX:
vboxnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00
inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255
I can ping my OSX box from Windows 7, but when I try to visit http://192.168.56.1:8080 I simply get an error that looks like I'm not connected.
Any ideas? Am I missing something in my OSX settings?
edit:
netstat -lan |grep 8080:
tcp46 0 0 *.8080 *.* LISTEN

Problem solved.
Adapter 1: NAT
Adapter 2: Disabled

Related

New-NetIPAddress not working in WIndows Powershell: Invalid parameter InterfaceAliase Local Area Network

My computer has a Windows 10 and I was following through Microsoft 98-366 Network Fundamentals book.
It had me to open Windows Powershell and type
New-NetIPAddress -InterfaceAlias "Local Area Network" -IPv4Address 192.168.1.101 -PrefixLength "24" -DefaultGateway 192.168.1.1
Then I got the error that it can't find a parameter with the name IPv4Address. It'ns not a typo though, because above was directly copied from the book.
So when I looked up the documentations on New-NetIPAddress it seemed -IPv4Address is not an option and instead I have to use IPAddress. So I tried the below
New-NetIPAddress -InterfaceAlias "Local Area Network" -IPAddress 192.168.1.101 -PrefixLength "24" -DefaultGateway 192.168.1.1
Then I got a new error saying
New-NetIPAddress : Invalid parameter InterfaceAlias Local Area Network
but InterfaceAlias does exist in the documentations, so I'm not sure what causes it to be invalid.
Thanks in advance for any kind of help.
Additionally, the documentation I looked up was this:
Net-NetIPAddress
I think the InterfaceAlias is not valid.
First look at all the network interfaces using the command Get-NetIPInterface. Here is the output in my PC:
InterfaceAlias
--------------
vEthernet (Wi-Fi)
vEthernet (VMware Network ) 2
vEthernet (VMware Network )
vEthernet (VirtualBox Host)
vEthernet (Ethernet)
VMware Network Adapter VMnet8
VMware Network Adapter VMnet1
VirtualBox Host-Only Network
Local Area Connection* 10
Local Area Connection* 9
Ethernet
Wi-Fi
Loopback Pseudo-Interface 1
vEthernet (Wi-Fi)
vEthernet (VMware Network ) 2
vEthernet (VMware Network )
vEthernet (VirtualBox Host)
vEthernet (Ethernet)
VMware Network Adapter VMnet8
VMware Network Adapter VMnet1
VirtualBox Host-Only Network
Local Area Connection* 10
Local Area Connection* 9
Ethernet
Wi-Fi
Loopback Pseudo-Interface 1
Re-check by reading all properties with Get-NetIPInterface | Format-List * will help you identify which is the correct network interface you are looking for.

how to network to and from local VM (fusion) with fixed IP on mac os host

I am running a VM (Debian) on MacOs using VMware Fusion. The VM has fixed IP address (required) and the networking is bridged. It all works very well in my local network under 192.168.1.XXX ip range. The problem is when I leave home and connect to internet via 4G or some public wifi etc. In this situation my Host OS (Mac) obviously gets a different ip address and the VM (Debian) becomes inaccessible from the host mac os. I would really like to be able to keep the VM on the fixed 192.168.1.XXX address even outside of my home network. That is to be able to connect to the guest from the host and also to connect from the guest to the outside internet (as I am able to do when on the home network). Could you please advise on ways how to achieve that. Thank you.
EDIT1:
More googling gained this link .. I followed the steps and created adapter as per the screenshot attached. I am now able to ssh to the VM from the MacOs host (progress!), however the connectivity from the Debian VM to the internet still does not work. Ping 8.8.8.8 fails. My network setup on the Debian VM is:
/etc/network/interfaces:
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.177
netmask 255.255.255.0
gateway 192.168.1.1
/etc/resolv.conf:
nameserver 192.168.1.1
nameserver 8.8.4.4
EDIT2:
netstat -nr on the host:
Destination Gateway Flags Refs Use Netif Expire
default 172.20.10.1 UGSc 141 64 en0
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 5 420 lo0
169.254 link#10 UCS 0 0 en0 !
172.16.37/24 link#19 UC 2 0 vmnet1 !
172.16.37.255 ff:ff:ff:ff:ff:ff UHLWbI 0 9 vmnet1 !
172.20.10/28 link#10 UCS 1 0 en0 !
172.20.10.1/32 link#10 UCS 1 0 en0 !
172.20.10.1 XXXXXXXXXXXXXXXXX UHLWIir 56 440 en0 1192
172.20.10.6/32 link#10 UCS 0 0 en0 !
172.20.10.15 ff:ff:ff:ff:ff:ff UHLWbI 0 9 en0 !
192.168.1 link#20 UC 2 0 vmnet3 !
192.168.1.177 0:50:56:35:35:b UHLWIi 2 756 vmnet3 1180
192.168.1.255 ff:ff:ff:ff:ff:ff UHLWbI 0 9 vmnet3 !
192.168.114 link#21 UC 2 0 vmnet8 !
192.168.114.255 ff:ff:ff:ff:ff:ff UHLWbI 0 9 vmnet8 !
224.0.0/4 link#10 UmCS 2 0 en0 !
224.0.0.251 1:0:5e:0:0:fb UHmLWI 0 0 en0
239.255.255.250 1:0:5e:7f:ff:fa UHmLWI 0 54 en0
255.255.255.255/32 link#10 UCS 1 0 en0 !
255.255.255.255 ff:ff:ff:ff:ff:ff UHLWbI 0 128 en0 !
According to the VMware docs here, the ping from the guest to the outside should "just work" in this setup, but it does not.
Try using a host-only or NAT network setup instead of bridged. A bridged adaptor will always give your VM an IP address from whatever wireless/ethernet network your host machine resides in at a given time. Using a host-only or NAT setup should allow you to create a private network between your host and VM in which you can get a static IP for your VM. The link I posted is for VMware Workstation, but the network options should be relevant to Fusion as well.
Talking to VMware support gained a solution that is acceptable. They recommended setup with 2 adapters. This way both ssh into (via one adapter that keeps the same fixed internal IP address) and connections to the internet (second adapter with dhcp) work fine.

Why docker allow me to run container on 192.168.8.101:8082 and localhost but not on other IPs

Hello I have following dockerfile on my macOS Sierr High (as example):
FROM richarvey/nginx-php-fpm:1.3.7
EXPOSE 80
And I'm able to build and run it on 192.168.8.101:8082 by
docker build -t myproject
docker run -d -p 192.168.8.101:8082:80 --name myproject myproject
and it works on http://192.168.8.101:8082 my local computer and devices (iPhone) connected to the same wifi network (I also have no problem to run container on localhost).
However when I try tu run this container on other IP like for example 192.168.8.102:8082 I get following error:
Mac-mini-Kamil:myproject Kamil$ docker run -d -p 192.168.8.102:8082:80 --name myproject myproject
f939d38243f420f812c859f5fe275faf49dc6e123d807583ec240fbdf0619a17
docker: Error response from daemon: driver failed programming external connectivity on endpoint myproject (0b546e63887e3ddeb4d2b21a8d6d15a94e33f1ff67c2765174a808bf6b13e120): Error starting userland proxy: listen tcp 192.168.8.102:8082: bind: cannot assign requested address.
I try also other addresses like 172.17.1.2 but with no success and I don't have idea why. Do someone cane give me advice (and/or instruction about what more information I should provide to this question to solve it) ? I would like to know: why I cannot use other IPs and what I can do to use other IPs?
UPDATE - additional informations:
After execute ifconfig I selected two interesting results :
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether a8:8e:24:a3:d3:91
inet6 fe80::18fe:1146:6389:b630%en1 prefixlen 64 secured scopeid 0xa
inet 192.168.8.101 netmask 0xffffff00 broadcast 192.168.8.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 32:00:11:fc:70:40
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 9 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: <unknown type>
status: inactive
The output of ifconfig (linux, OSX) or ipconfig (Windows) will probably tell you that your IP4 is 192.168.8.101.
That's reason why 192.168.8.101:8082:80 works. Docker can access the endpoint and can map port 80 of its container on port 8082 of 192.169.8.101.
When you use another IP this error will pop up:
Error response from daemon: driver failed programming external connectivity on endpoint
This means your Docker daemon can not access the endpoint 192.168.8.102 which is logical because it isn't the IPV4 address of your machine.
The bridge0 network is the default Docker network. If you don't specify a network your Docker container will be deployed inside this network.
You can do: docker inspect network bridge
The output of this command will return a subnet like "Subnet": "172.17.0.0/16". Every container will have an IP between this private range.
What you are actually doing is mapping 172.17.X.X:80 on 192.168.8.101:8082 which works when 192.168.8.101 is accessible from you machine.
i suspect that your previous container still using port 8082 try using another port. . i dont know how to check used port in mac but if its in linux you can check your open port with netstat -ntlp

How to Add Virtual Network Interface Mavericks

I like to have a separate virtual network interface on Mavericks, so I can have static IP between the Guest to Host setup of VirtualBox. In xUbuntu, i could do that by updating /etc/network/interfaces:
#The secondary network interface
auto eth1
iface eth1 inet static
address 10.88.12.4
netmask 255.0.0.0
How to do the same in Mac Mavericks? I did try using 'system preferences'->Networks->Actions Menu->Manage Virtual Network Interfaces->Add New VLAN, however, it is giving 'Status: Cable Unplugged'. How to make virtual network interface on Maverick? Thank You
The solution was letting VirtualBox create the virtual network interface by creating "Host Only Network" by going VirtualBox VM -> Preferences -> Network -> Host Only Networks -> Add New and set up the IP/Subnet at that time
Afterwards, check the new virtual network interface by typing "ifconfig" in the command line. It will desiplay something like:
vboxnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00
inet 10.88.12.0 netmask 0xff000000 broadcast 10.255.255.255

Assign static local ip address to OS inside virtual machine with bridged connection

I have win 7 OS on my laptop, and linux(debian 7) inside vmware. I have set the debian to have bridged connection with the network. I am connected by wifi, and if the wifi modem is being restarted the local ip address of the debian changes, e.g. from 192.168.0.106 to 192.168.0.102. Is there a way to set the local ip address, so it will always remain the same ?
Thanks
You have to change your /etc/network/interfaces like this
and after that remember to restart your service using
sudo service networking restart
ok, found the solution
here is the source
http://www.cyberciti.biz/tips/howto-ubuntu-linux-convert-dhcp-network-configuration-to-static-ip-configuration.html
basically for debian
1) vim /etc/network/interfaces
2) comment/delete this line iface eth0 inet dhcp
3) add this
iface eth0 inet static
address 192.168.1.106 # this is the ip address you want to assign
netmask 255.255.255.0
network 192.168.1.0

Resources