Virtualbox: Using firewall in ubuntu guest - virtualbox

I have windows 7 pro host with ubuntu server 12.10 as guest. The host has a static ip. The networking mode is NAT with port forwarding from host port 22 to guest port 22. I don't want to use use bridged networking because of company policies.
I need to ssh (port: 22) into the guest from the internet and I want to limit inbound connections to guest port 22 to certain ip addresses. So I enabled ufw in the guest and added rules to it. When I try to ssh into the guest from one of the allowed ip addresses, it's not connecting. If I disable ufw, it works.
What could be wrong? I don't know much about NAT and guest firewalls.
Thanks in advance for your response.

this is normal, because the guest VM (Ubuntu) will receive the connection from the NAT Gateway IP (ie the host (Win7) address) and not the client who is connecting to ssh.
to solve this issue , you will need to remove ufw rules and set the same rules in the host windows firewall.

Related

No internet connection in a VM Guest

I am using VMWare. I am using a default NAT setting. I am unable to ping to an external url from within the guest OS. The firewall on the host Windows OS is the Symantec Endpoint Protection and I have created some firewall rules for allowing network traffic on ports 22, 80, 53 etc. I am still unable to ping.
I tried changing the network setting to Bridged but then starting the VM os gives an error message 'Connectivity issues detected'
Can someone help?
I reimported the image and started the VM guest it seems it is working fine.

VMware have network access but can't ping anywhere

I am using VMware 9.0.0 on a Windows 7(64bits) host, the guest OS is CentOS 6.5(I have tried Ubuntu 12.04 also).
Firewall on Windows 7 is completely disabled. My host is connected to a router via wireless network adapter.
Guest's network configuration is NAT, and guest IP address is 192.168.117.130. Default gateway of the guest is 192.168.117.2. The Nat Interface(VMware Network Adapter VMnet8) on Windows 7 have an IP address of 192.168.117.1.
The problem I met is that I can have Internet access, actually, every network service using TCP and UDP is ok. But I can't ping any host other than hosts on the network of 192.168.17.0/24.
I used wireshark to locate the problem. I found a strange phenomenon, my host can receive the ping echo request from the guest and ping echo response, but it is not forwarding to the guest. Seems the NAT of ICMP packet is not working.
Any suggestions?

Web service not accessible on host

Folks, I published a web service on iis7 on a remote win on vm ware and I can't acess it on the host os, even though I set up Nat port forwarding on vm ware and opened the corresponding port on the host`s firewall settings.
My web service ip on guest is http://localhost:80/webservice.asmx
Even when I try the same address with 9997 port on the host it won't work after opening port 9997 on firewall and setup a port forward on Virtual network editor on vmnet8 (NAT)
Found the solution,
I just needed to disable firewall on Guest both Home and Public Networks.

how to ping guest xp from host ubuntu in virtualbox?

I have a ubuntu in my lap top and install virtualbox. I install an xp as guest in vbox.
I want to have access to guest from host for penetration usage.
#1st try: the guest uses bridge network with ip 192.168.1.103 (assigned static).
I can not access guest form host, when I ping the guest, loosing all packages.
ping 192.168.1.103
But I can access host form guest, when I ping the host.
ping 192.168.1.101
#2nd try: the guest uses an NAT and a Host-Only network.
same as above host can not access the guest:
ping 192.168.56.103
but guest can access the host:
ping 192.168.56.1
who can I access the guest from host?
As you can ping host from the guest, it tells that the connection is working ok both ways (response comes back ok). The problem probably is that XP has not been configured to answer to ping requests so it's silently discarding them. You need to change the settings of the firewall to allow answers to ping.
See for example http://kb.iu.edu/data/aopy.html for details how to enable ping service in different Windows versions with the default firewall.

How to enable connection to virtualbox machine from outside the Host (i.e. from any PC connected to Internet)

I have a Host with VirtualBox installed and Guest installed (both with Windows XP SP3).
I do have connection between them. And also the guest have an internet connection.
I can connect via Remote Desktop Connection from Host to Guest, but I also want to be able to connect to Guest from any other PC. If can, how to achieve this?
Guest is using 2 network adapters, one NAT for sharing the internet connection and then one Host-only to be able for both machines to see each other on the local network.
Assuming you have an Internet router providing access to your ISP...
Change the VM networking from NAT to Bridged.
Check that the guest still has Internet connectivity after rebooting or ipconfig /renew.
Configure the router to give the guest a fixed IP address. (Typically, the guest can still use DHCP but the router is configured to give the guest the same IP address every time.)
Determine which ports and protocols needed to connect with the guest. E.G, TCP on port 3389 (RPD) for Remote Desktop.
Configure the router's "port-forwarding" feature to route external connections to the IP address of your guest. You can designate a different port for the external connections but that might not get through firewalls between the remote computer and its ISP.
Determine the external IP address of your Internet router.
Connect from the remote computer to the IP address and designated port.