I'd like to ask you guys if there is a way for me to install ubuntu on a virtual machine and then make it have its own IP, either with hamachi, vpn or such?

Thanks in advance!!

  • 2
    Yes, public IPs can be assigned to any sort of network device. – music2myear Jun 24 at 16:49

I mostly only have experience with VirtualBox, so I'll give you a tutorial on how to to this in VirtualBox.

  1. Locate the virtual machine that you want to give a public IP.

Your virtual machine

  1. Then navigate to that virtual machine's settings, then to the "Network" tab.

Your virtual machine's settings

  1. Change the option "Attached to:" to "Bridged Adapter"

Bridged Adapter

  1. Restart your virtual machine.

  2. If you need to change your interface's dhcp assignment to a static ip, you can read about that here.


  • Sorry, I forgot to mention that this mini-tutorial assumes that you already have a virtual machine created. – johnbchron Jun 24 at 17:14

In theory you can assign a host whatever IP you want. If you statically assign a public IP you need to have an IP to allocate. You have to be assigned the IP. You can't just go assigning a public IP if it's not yours. If you are using a residential network you are only given one Public IP that is usually assigned via DHCP. So you would have to give the VM a private IP address then use NAT/PAT to make the machine externally accessible.

If you do have multiple public IPs assigned to you from your ISP just assign it an IP for the ones designated by your ISP. It should be routable then you can just assign it a DNS host name to make it easier to access.

VPN is up in the air. Depends on how the VPN provider has their service setup, and how their network is implemented. So even if they give your PC a public IP address you might not be able to access your machine publically.

In short look into IP Classes and why they exist. Network Address Translation and Port Address Translation would be extremely helpful. Some basics into routing protocols (EIGRP, OSPF, and BGP) and Firewall technologies and how they also restrict flow of traffic. All these considerations can impact how you approach assigning IPs and accessing your machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.