How can I assign a static IP address to my phone's hotspot?

I use the hotspot on my Samsung M31 to connect my laptop running Windows 10 to the internet.

I also have Oracle's Virtual Box VM running a few test websites on the laptop on Ubuntu Server 22.04, which need a static IP address to access.

A few days back when I ran ipconfig at the Windows command prompt, it showed my wireless IP address as Today, it show as Meaning, all my sites are now broken. Is there a way to stop the hotspot from changing IP addresses?

Can someone please help?

  • In my opinion this is simply a matter of configuration in VirtualBox. If you want to access the host from within a VM add a host-only network (the VM has then two network adapters). This network is then configured and maintained by VirtualBox on the host and will work even without any hotspot connected.
    – Robert
    Jun 6 at 16:14
  • @Robert Thanks for pointing me to the host-only network. I checked a few articles online and have got things going, but now my VM cannot connect to the internet for updates etc. I've added NAT as a second adapter, but that too does not solve the problem.
    – Norman
    Jun 7 at 6:16
  • What guest OS do you use? From my experience some Linux distribution s(e.g. Ubuntu 22.04) do not automatically configure the new interface so I had to manually configure the interface to make it work.
    – Robert
    Jun 7 at 7:02
  • I'm using Ubuntu Server 22.04.
    – Norman
    Jun 7 at 7:10


You must log in to answer this question.

Browse other questions tagged .