Hyper-V VM (NUC image) starting up but not downloading application

I’ve created a virtual machine in Windows 10 using Hyper-V, and converted the Balena .img file (NUC) to a Hyper-V .vhdx file using qemu-img. The VM starts up fine, and I get to the Balena logo screen, but that’s where it stops each time. The device registered with Balena Cloud, but it shows as being “Online (VPN only)” - but never actually downloads the app, nor can I connect to its terminal through the Balena Cloud terminal. I am able to access the device by directly logging in to its terminal (alt-F2) and can confirm it has internet access. Has anyone successfully got this working - and if so could they share how it was done?

Hi David,
Reading up about Hyper-V it might not be the best choice for Linux systems generally. We have instructions on how to run balena on VirtualBox here https://www.balena.io/blog/no-hardware-use-virtualbox/ .
If your device shows up in the dashboard it is likely working. The balena logo screen is what you see if you are using a production version.
You can try to establish a ssh session to your device by opening a web console from the dashboard or by using the balena-cli ( https://github.com/balena-io/balena-cli ).
You can establish a ssh session directly after adding your ssh-key to config.json or if you use a development image of balena.
Regards Thomas

Hi. Just to add to what Thomas said, when you are able to login, can you also check the status of openvpn using the journalctl --no-pager -u openvpn command?

I am actually able to connect to the terminal on the local Hyper-V machine by pressing alt-F2 and logging in as root (no password since it is in dev mode). See screenshot below of the output of the journalctl --no-pager -u openvpn command. It looks like there is an error relating to a route add, towards the bottom, not sure if this is the issue?

Unfortunately I am stuck with Hyper-V because I’m using WSL2 for my local Ubuntu dev environment, and WSL2 requires Hyper-V, which conflicts with VirtualBox.

So it looks like it connected fine. Can you also run curl https://api.balena-cloud.com/ping ?

Got the response “OK”

So it can reach the API. Now can you check journalctl --no-pager -u resin-supervisor ?

Looks like no entries for resin-supervisor – see below:

@floion I found the issue - looks like I hadn’t created the second drive for downloading data. I had mistakenly assumed it would just expand the Balena image, but everything is now working fine. Thank you!

And to others who are interested in doing this - it’s pretty simple:

  1. Download qemu-img, extract it to a folder, and place your balena image (NUC) in that folder
  2. Run qemu-img.exe convert balena-image.img -O vhdx -o subformat=dynamic hyperv-balena-image.vhdx
  3. Create a virtual machine in Hyper-V (I used the second generation setup), disable secure boot, and ensure it has network connectivity
  4. Create a new (empty) hard drive for your first drive, and load the hyperv-balena-image.vhdx for the second (the order is important, it doesn’t work the other way around)

These are the steps that worked for me, hopefully it works for others too.

@drcnyc that is super cool! Glad you figured it out and came back to share your solution with the community!