Connecting to internal network

Discussions about using Linux guests in VirtualBox.
Post Reply
lkoll43
Posts: 7
Joined: 7. Jun 2022, 16:35

Connecting to internal network

Post by lkoll43 »

I am attempting to work my way through a tutorial that requires setting up a few machines on virtualbox and connecting them to an internal network. I was going to post a link to the tutorial, but as a new member I am unable to post urls.

Under each machine->Settings->Network, under Attached to: I have selected Internal Network and named the network re101net.

I believe I have successfully connected my Windows machine to the network as I can see that it is connected in the network settings to a network without internet access, but I am less familiar with Linux and am having more trouble connecting there. When I open up Preferences->Advanced Network Configuration, I select the "+" and it says "Choose a Connection Type" with a lot of options, I've uploaded a screenshot of what I'm seeing for options. Which of these options do I need to select in order to get my Linux machine connected to the network? Or am I missing something entirely here? Appreciate any guidance.
Attachments
Ubuntu Network Options.JPG
Ubuntu Network Options.JPG (52.8 KiB) Viewed 5565 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to internal network

Post by scottgus1 »

I'd wager you'd connect to "Ethernet". Virtualbox only provides wired Ethernet adapters for the VM OS's to see and use.

Be aware that Internal only provides a "cable" (and an "unmanaged switch") between the VMs connected to Internal, but no DHCP by default, and no outside access. See Virtualbox Networks: In Pictures: Internal Network
lkoll43
Posts: 7
Joined: 7. Jun 2022, 16:35

Re: Connecting to internal network

Post by lkoll43 »

When I attempted the ethernet one I couldn't seem to get it to work, but there seems to be a whole host of settings available and I'm not sure what to configure things to in order to connect? I attached a screenshot of all the settings, I can't seem to have it "find" the network connection with any I've tried so far.
Attachments
Network Settings.JPG
Network Settings.JPG (60.83 KiB) Viewed 5549 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to internal network

Post by scottgus1 »

How to tell a Linux OS to find and use its Ethernet connection is a bit beyond the scope of this forum, but we can check if the Virtualbox connection is connected.

1. Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.

2. Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. Zip the VM's .vbox file (not the .vbox-prev file), and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file.)

3. In the Linux OS, open a Terminal and run ifconfig or ip address. Post the command output.

Also, don't forget:
scottgus1 wrote:Internal ... provides ... no DHCP by default
If a Windows OS connects to a network that does not have DHCP active, Windows will self-assign an APIPA address to the network adapter. I don't know if Linux will do this; a web-search will tell. If the Internal network is properly connected, your OS won't get an IP address or internet. You may have to set a static IP address in both VMs compatible with each other.
lkoll43
Posts: 7
Joined: 7. Jun 2022, 16:35

Re: Connecting to internal network

Post by lkoll43 »

Thank you for your help. For reference, here is the tutorial I was trying to walk through: https://malwareunicorn.org/workshops/re101.html#2

I have attached the two files you requested. When I run ifconfig and ip address I get the following results:
terminal output.JPG
terminal output.JPG (62.45 KiB) Viewed 5436 times
Point taken about the internal network... Like I said I was trying to follow along with the above link and that's what they recommended but maybe I will have to investigate other methods if it isn't working.
Attachments
Sniffer-2022-06-09-16-51-05.zip
(28.91 KiB) Downloaded 4 times
Sniffer.zip
(1.44 KiB) Downloaded 2 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to internal network

Post by scottgus1 »

Thanks for the info!

From the log:
00:00:02.297782 CableConnected <integer> = 0x0000000000000000 (0)
The VM's network "cable" is not connected. (The 0 would be a 1 if connected). See the VM's Network setings, Advanced dropdown, "Cable Connected" checkbox.

One other thought on that tutorial: if you take the recommended snapshot while the VM is running, the VM will be tied to the version of Virtualbox you're running. You could take a snapshot while the VM is shut down fully, to maintain host Virtualbox upgradeability. Or you could simply make a copy of the VM folder while the VM is fully shut down. Restoring to working state is simply copying the copy back over the original while Virtualbox is shut down. Then you wouldn't have to bother with the snapshot.
lkoll43
Posts: 7
Joined: 7. Jun 2022, 16:35

Re: Connecting to internal network

Post by lkoll43 »

Thanks for the tip on the snapshot, I will be sure to do that.

Thanks also for pointing out CableConnected property as well. As you mentioned before this may be getting a little out of the scope of this forum so I can take it elsewhere if so, but even with that property changed I am still unable to connect to the internal network. If you have other thoughts I'd be happy to hear them.
terminal output2.JPG
terminal output2.JPG (59.6 KiB) Viewed 5304 times
Attachments
Sniffer-2022-06-13-08-14-09.zip
(28.99 KiB) Downloaded 3 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to internal network

Post by scottgus1 »

OK, the cable is connected now, and the "state" is reported as "UP". However, if this:
lkoll43 wrote:I am still unable to connect to the internal network
means you're expecting an IP address to be given to your VM, then you need to dwell on the Pictures tutorial a bit more, especially in regard to there being no DHCP server on an Internal network, as also mentioned above.

You have two "computers" connected with a single network cable now. Next, you need to configure the OS's to talk to each other over that single cable.
lkoll43
Posts: 7
Joined: 7. Jun 2022, 16:35

Re: Connecting to internal network

Post by lkoll43 »

Thank you for your help!
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to internal network

Post by scottgus1 »

So you're up and running? If so, what did you do to get things working?
lkoll43
Posts: 7
Joined: 7. Jun 2022, 16:35

Re: Connecting to internal network

Post by lkoll43 »

I had to change my ethernet connection to manually specify an ip address, netmask, and gateway. I am now able to ping my ubuntu vm from my windows one, but not vice versa. But at least both are seemingly connected to the re101net now. Picture below for the settings I used.
Ethernet Settings.JPG
Ethernet Settings.JPG (48.1 KiB) Viewed 5208 times
Pinging Lubuntu vm
ping lubuntu.JPG
ping lubuntu.JPG (36.95 KiB) Viewed 5208 times
Pinging windows vm
ping windows.JPG
ping windows.JPG (24.55 KiB) Viewed 5208 times
Still troubleshooting that last one but I'm not sure if I need that for what I'm working through specifically or not as it doesn't seem to mention it.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to internal network

Post by scottgus1 »

lkoll43 wrote:I had to change my ethernet connection to manually specify an ip address, netmask, and gateway.
Good, that's what is needed when two PCs are connected with a cable. But you wouldn't bother with a gateway. Gateways are for internet, and there is no internet on an Internal network. (Unless you're setting up an Active Directory server, then you'd follow the directions carefully.)
lkoll43 wrote:I am now able to ping my ubuntu vm from my windows one, but not vice versa.
Windows Firewall defaults to block ping. Enable "ICMP Echo Request" in the Windows Firewall.
lkoll43
Posts: 7
Joined: 7. Jun 2022, 16:35

Re: Connecting to internal network

Post by lkoll43 »

Good to know about the gateway, I will remove that from the settings.

Thanks for the tip on the Windows rule, that solved it!
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting to internal network

Post by scottgus1 »

Great! Glad you're up and running.
Post Reply