Page 1 of 1

Can't get VM to connect to internet through another VM

Posted: 4. Nov 2016, 06:43
by RyanW
I'm following Dr. Fu's tutorial on Malware Analysis using Reverse Engineering, as part of it I'm supposed to set up two VMs, one Ubuntu, one Windows XP. The XP VM is supposed to connect to the internet through the Linux VM so I can monitor what it does.
I've gotten the Ubuntu VM to connect to the internet, and the XP VM to connect to the Ubuntu VM (says "connected"), but it won't load any webpages.

Here is the script I ran on the Ubuntu VM for forwarding

Code: Select all

 sudo sysctl -w net.ipv4.ip_forward=1
 sudo iptables -P FORWARD ACCEPT
 sudo iptables -t nat -A POSTROUTING -o enp0s8 -j MASQUERADE
enp0s8 being the internal name of the network adaptor on the Ubuntu VM that the XP VM connects to. Was found using ifconfig on Ubuntu.
What am I doing wrong? I can post pictures of all my settings if needed.

Re: Can't get VM to connect to internet through another VM

Posted: 4. Nov 2016, 09:18
by socratis
RyanW wrote:I'm following Dr. Fu's tutorial on Malware Analysis using Reverse Engineering
If you're referring to this one (http://fumalwareanalysis.blogspot.gr/p/ ... verse.html), then there are a couple of things that you'll need to understand:
  1. It's kind of old. From 2011.
  2. It's kind of big. Don't expect anyone, but Dr. Fu and you, to read the whole thing in order to help you. I started reading it, but don't expect that too many people will. Plus, I'm not going to install all the things that are mentioned in the tutorial.
  3. You'll need to understand the basis of the problem and describe your issue, instead of blindly following the instructions. which are vague, old or flat our wrong. Examples:
    • The instructions refer to "install this guest". No word on the network settings. It just says "it should work". Huh??? Does it assume NAT? I wouldn't know.
    • It talks about manually changing the NIC addresses. There might be some purpose for this, didn't read the whole thing.
    • It talks about changing the IP address to 169.254.236.100. That's an APIPA address. Why use it on the internal network???
As I said: understand the why, and if you have a VirtualBox specific problem, please try the question again with more specific details.

Re: Can't get VM to connect to internet through another VM

Posted: 5. Nov 2016, 06:58
by RyanW
Hey thanks for responding! Sorry, I wanted to post more details but I wasn't allowed to post links yet. That was the top tutorial I was recommended to study from the company I will be interning for. The relevant section on the tutorial to my question is Part 3
Here are my settings: http://imgur.com/a/d3TW9

From reading the comments on it, I got the impression that a lot of the settings were security oriented, such as to hide the VMs from the internet.
Basically my question is; is my unable to connect an issue with my VM network settings or with Ubuntu?
Thanks for your time, and sorry to bother you.

Re: Can't get VM to connect to internet through another VM

Posted: 5. Nov 2016, 08:45
by socratis
  1. As I said, I will not try to follow a multi-page tutorial from 5 years ago to help you follow it blindly. You need to describe what you want to do in detail, i.e. I want to have a VM 1 that connects (via an internal network) to another VM 2, that has two network cards (one internal, one Bridged/NAT) and do XYZ without doing ABC. Something like that...
  2. Please do not post links to 3rd party sites. You can post images here, if you have to. See the "Upload attachment" at the bottom of the reply form.
  3. Don't worry, you don't "bother me"... ;)