How can I setup network for my VDI image?

I am trying to run an express unikernel in VirtualBox, however when I bootup my image, I am getting errors.

  • The first error is: No network module found
  • the second is node error, MODULE_NOT_FOUND

this is my config.json file

{
  "Args": ["app.js"],
  "Files": ["app.js", "package.json"],
  "Dirs": ["node_modules"],
  "RunConfig": {
                "Bridged": true
        }
}

I am attaching screenshots of errors and VirtualBox configuration:


When I am running the application in my linux machine with ops it is working properly.
What do I need to change to make the unikernel run?
thank you.

Can you provide a bit more detail?

What is the host system here? Linux?

How are you creating the image and instance? Using ‘ops image create’ and ‘ops instance create’?

At first glance it seems that you have two issues here:

One is the network issue but the other looks to be app specific. In your screenshot you are clearly booting into node but it’s not finding your unikernel_first.

For the network issue, without looking, you might be able to get around that by choosing a diff. network driver such as virtio-net.

I am creating image usingops image create -c config.json —package eyberg/node:20.5.0 -i unikernel_first -t vbox in my linux machine.

Then I transferred the .vdi with scp to my windows machine.

the host system is windows 11 with hyper-v disabled, and using oracle Virtual box as hypervisor.

However, in the linux machine where I am creating the unikernel, if I run command ops pkg load -c config.json -p 3000, the app runs properly and I can consume the api as well.
Please let me know if more info is necessary.

Ok that makes a lot more sense.

Generally when we make images we make them for a specific target hypervisor/cloud.

I think if you try changing the network adapter from ‘pcnet-fast iii’ to ‘virtio’ that might fix your networking issue.

The other one looks like purely an application level issue - such as a missing file/directory. If you have something that is a hello world example to paste in that would be helpful.

Since you are creating vdis on linux - are you able to run them on linux using virtualbox as well? If so that helps isolate your issue to windows.

1 Like