(I don’t know if this belongs under “Newbie” because I feel like a n00b here…)
I’m having a weird problem within QEMU on my laptop, and I’d like help debugging and fixing it:
When I’m on the wifi network at work with my laptop, I can NOT do DNS lookups within QEMU.
When I’m on my home wifi network OR use my phone as a hotspot, DNS looks DO work within QEMU.
For completeness: DNS works from on my laptop (firefox, ping, …) in any of above setups.
I would like to be able to reach the network from QEMU from my work network too.
I’m experiencing the exact same behavior within the Android Emulator, which I believe is a fork of QEMU.
I first looked into the firewall and ensure the two connections used the same profile, but since that didn’t change anything I ended up disabling the firewall entirely. This did not affect the problem.
QEMU or any other virtual machine software uses NAT (Network Address Translation). Which translates your normal IP to another virtual IP that is in a different IP range than your host computer.
You can manually change the connection type to bridge the network connection. Which should emulate your physical network card behavior.
I don’t know how your office/workplace firewall is set up (normally offices do have a hardware firewall nowadays). Firewalls are configured to stop alien IP ranges from accessing outside of the LAN or wise versa.
This is done to prevent users from using virtual environments to do bad things using offices or any other important connections. But when it comes to your home connection and or your phone hotspot. They don’t have the level of security of your office. Consumer devices are configured to be more simple and hassle-free. This might be why you’re not allowed to access the internet using your VM when at the office.
I also have advice. Check your office’s cyber or data security policy before trying to use VMs. Because using VMs is frowned upon. Because most people use VMs to mask what bad things their doing or to get around a security policy. Most companies will fire people on-site as soon as they find them using VMs without prior authorization.
If you really need to use your VM then get the proper authorization and get your administrator to set up the firewall so it allows your virtual IP addresses.