Configuring Networking in OpenBSD HVM

Hello, friends.
I was trying to create a openbsd hvm and even got succeded in doing so. But I somehow did broke its connectivity ( I was never able to access internet from this hvm). I think I set up networking in wrong way.
My method was-

  1. I downloaded Install67.iso from official OpenBSD website.
  2. Then I created and started an empty standalone hvm qube with this iso.
  3. Followed Installation and completed it. I tried to manually setup network interfaces during install, but had no idea how to do it in proper way.
  4. Openbsd is able to start and I can login and access terminal in it.
  5. No idea how to have connectivity in this hvm.

Can somebody please help.

Do you know how to configure networking in openBSD?
If not, read this:

The network settings you need are on the Basic Settings tab for the HVM
you have created. This shows IP and gateway.
Use a netmask of

You can either use the Qubes DNS IP addresses, or , or similar.

Okay, so I tried a reinstall.
Installation details-
which interface you wish to configure- xnf0 vlan0
I configured only xnf0 with following-
IPV4 address for xnf0?
IPV6 address? none
Default IPV4 route?

The details on basic tab of settings were
IP address-

No success in connection after that.

(mod edit: @wobo I edited the title to make this thread easier to find, if you feel it’s not adequate, feel free to change it)

There was no need to reinstall.
But as you did, why didn’t you set the gateway correctly?

You haven’t said what trouble shooting steps you have taken. Have you
made sure that the issue isn’t with DNS by testing connection to an IP

Sorry as I am newbie to OpenBSD but I have given info what was asked during installation and what I provided. Gateway was not asked during install and Can these settings be modified after install. I cannot find a good documentation about it. Either way @unman can you suggest me if what should I have provided in these settings. Are those should be-
IPV4 address
IPV6 none
Default IPV4

Although I gave DNS address from basic tab itself.
Where to put gateway.
Qubes provided gateway to OpenBSD hvm is
One last thing do I have to configure xnf0 or vlan0. My understanding about it is that I have to configure only xnf0.
I understand that this is not OpenBSD forum but there is a documentation on Qubes website about installing openbsd as hvm and that really far away from how I installed it. I cannot understand that doc page. Doesn’t it need an update for current situations.

if qubes settings tells you:


you need to have:

in /etc/hostname.xnf0:


in /etc/mygate:

in /etc/resolv.conf:


that should be it

then run sh /etc/netstart xnf0

forget about vlan0

sometimes the nic gets stuck. just reboot the qube if config is correct but cant ping default gw or

/etc/hostname.xnf0 tells
inet netmask 0*ffffff00
when I try vi /etc/mygate it shows empty file. When I tried to put there, I was unable to do same as it was readonly even when I was logged in as root. Then I tried cat /etc/mygate it shows file not exist.
Then I tried -

route add -netmask

result was -
add net gateway Network is unreachable.

I also used sh /etc/netstart xnf0 and also used reboot, results were same.

You have to have a gateway set in /etc/mygate.
Just create that file with the content:

You cant set a route as you have because the system doesn’t know how to
get to the gateway that you have set in that route.

just noticed your gw/netvm is and your qube ip is…you are using a disposable qube for netvm?

you will need additional routing to make it work since qube+netvm/gw subnets are diff but they are ‘directly’ connected.

use this in /etc/hostname.xnf0:

!route add -iface -cloning

and in /etc/mygate:

the !route in hostname.xnf0 makes sure bsd knows how to reach the default gw since its separate subnet

Good catch