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!!
I mostly only have experience with VirtualBox, so I'll give you a tutorial on how to to this in VirtualBox.
Restart your virtual machine.
If you need to change your interface's dhcp assignment to a static ip, you can read about that here.
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.