0

I am trying to get an old version of Ubuntu (12.04) to connect to a VPN, as a guest in VirtualBox. I have to use that old version of Ubuntu to build some software, and want to avoid upgrading as it's a massive amount of effort to built it on current versions. The VPN requires a recent version of OpenVPN, and I have been unable to get the current version to work on Ubuntu 12.

Host: Windows 10 VPN: OpenVPN Connect on host

I have two network adapters in the virtual machine:

eth0 - Bridged adapter, gets a local LAN IP address via DHCP. I can access the VM over VNC on this interface, and access the internet.

eth1 - NAT adapter, gets an IP address if 10.0.3.15. I don't know where this comes from, the VPN's DHCP hands out addresses in the 172.31.5.x range.

I have tried:

VBoxManage modifyvm <uuid or name here> --natdnshostresolver1 on
(Use Host VPN in Guest VM)
(Connecting Ubuntu VM to VPN)
(VirtualBox networking for both VPN and internet)

I also tried: sudo route add -net 172.31.0.0 netmask 255.255.0.0 gw 10.0.3.1 eth1
(Setting up networking on Virtualbox Guest to access Host VPN)
(Now to connect to a VirtualBox guest OS through a VPN?)

Of course that won't work because the 10.0.3.1 address is not being handed out by the DHCP server, it's a private address that seems to be used as a default for interfaces with no assigned address. Maybe something that VirtualBox assigns?

There are a few other similar questions, but they all have answers that are basically the same as the above.

I also tried setting the adapter to bridged mode, with the TAP adapter created by OpenVPN Connect. The interface does not get an IP address from DHCP.

For reference the Windows side VPN gets

IP address 172.31.5.9
Netmask 255.255.255.0
No gateway or DNS servers
WINS severs 172.31.1.2 and 172.31.1.12

1 Answer 1

0

That is an extremely old version of Ubuntu - probably why you cannot connect.

(Note about moving data to a more modern system removed)

You need to take the time to upgrade Ubuntu. That is, if you just need a connection into the machine, you will have to upgrade Ubuntu.

It is not likely a Virtual Box issue.

I can connect to all my virtual machines and host but they are all much more modern.

7
  • Thanks but I need to access a server on the VPN, for SVN access and testing. I can move files by drag-and-drop with the VirtualBox Extensions, that's not a problem.
    – user3241
    Commented Jun 1, 2023 at 15:10
  • It won't build without being able to contact machines on the VPN. It's not about copying some files.
    – user3241
    Commented Jun 1, 2023 at 17:53
  • 1
    @John This is not about moving files. OP's build process that runs on the VM needs access to a resource which is only available over the VPN. It's not a file that you can just plop in place.
    – gronostaj
    Commented Jun 1, 2023 at 18:44
  • 1
    Not necessarily. I can't provide what I would consider a complete answer, but OP could set up the VPN connection elsewhere (host/another VM/router) and make the VM use that VPN network.
    – gronostaj
    Commented Jun 1, 2023 at 19:38
  • 1
    No, it doesn't mean that. Please re-read my comment.
    – gronostaj
    Commented Jun 2, 2023 at 7:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .