How to compose a vbox platform image with new capstan

25 views
Skip to first unread message

robertob

unread,
Apr 14, 2019, 2:13:37 AM4/14/19
to OSv Development
I made package.yaml that correctly run with default QEMU platform, but now I do not understand how to build image for virtualbox platform. When I build the image (capstan package compose uni) I see every time that the QEMU image was created.

I tried this package.yaml file with "platform: vbox" but noting....

name: uni

title: Uni

platform: vbox


require:

    - openjdk8-zulu-compact3-with-java-beans

    - osv.httpserver-html5-gui-and-cli

    - osv.run-java

    - osv.cli

Roberto Battistoni

unread,
Apr 16, 2019, 2:03:01 AM4/16/19
to OSv Development
Hi guys! 

Any advice? Please I am very close to conclude my experimentations but QEMU is too slow and I need to do other tests with more efficient platform. 

thanks so much

r

-- 
You received this message because you are subscribed to a topic in the Google Groups "OSv Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/osv-dev/-fwSG-MY9Ks/unsubscribe.
To unsubscribe from this group and all its topics, send an email to osv-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pekka Enberg

unread,
Apr 16, 2019, 2:06:26 AM4/16/19
to Roberto Battistoni, OSv Development
Hi,

I don't think Capstan supports building VirtualBox images, but you can use the "qemu-img convert -O vdi" command to convert a QCOW2 (QEMU's format) image to a VirtualBox image.

- Pekka

You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.

Waldek Kozaczuk

unread,
Apr 16, 2019, 10:52:58 AM4/16/19
to OSv Development
The convert output should go under $HOME/.capstan subdirectory with the extension .vbox like so:

```
qemu-img convert -O vdi ~/.capstan/repository/app/app.qemu ~/.capstan/repository/app/app.vbox
```

If you are using Mac then qemu-img has a bug (https://bugs.launchpad.net/qemu/+bug/1776920) so you have to use a workaround (see https://bugs.launchpad.net/qemu/+bug/1776920/comments/14).

Can you tell us which development platform are you using to play with OSv? Laptop with:
- Linux
- OSX (MacBook)
- Windows
on it?

What version of QEMU? What version of VirtualBox?

Depending on it I might give you better advice on which accelerator (KVM, Intel HAXM, etc) to use with QEMU.

Waldek

On Tuesday, April 16, 2019 at 2:06:26 AM UTC-4, Pekka Enberg wrote:
Hi,

I don't think Capstan supports building VirtualBox images, but you can use the "qemu-img convert -O vdi" command to convert a QCOW2 (QEMU's format) image to a VirtualBox image.

- Pekka

On Tue, Apr 16, 2019 at 9:03 AM Roberto Battistoni <r.bat...@gmail.com> wrote:
Hi guys! 

Any advice? Please I am very close to conclude my experimentations but QEMU is too slow and I need to do other tests with more efficient platform. 

thanks so much

r

Il giorno 14 apr 2019, alle ore 08:13, robertob <r.bat...@gmail.com> ha scritto:

I made package.yaml that correctly run with default QEMU platform, but now I do not understand how to build image for virtualbox platform. When I build the image (capstan package compose uni) I see every time that the QEMU image was created.

I tried this package.yaml file with "platform: vbox" but noting....

name: uni
title: Uni
platform: vbox

require:
    - openjdk8-zulu-compact3-with-java-beans
    - osv.httpserver-html5-gui-and-cli
    - osv.run-java
    - osv.cli

-- 
You received this message because you are subscribed to a topic in the Google Groups "OSv Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/osv-dev/-fwSG-MY9Ks/unsubscribe.
To unsubscribe from this group and all its topics, send an email to osv...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv...@googlegroups.com.

robertob

unread,
Apr 17, 2019, 12:35:32 AM4/17/19
to OSv Development
I'm using Linux Fedora (Linux version 5.0.7-200.fc29.x86_64):

qemu-system-x86_64: QEMU emulator version 3.0.0 (qemu-3.0.0-4.fc29)

When I run the image through "capstan run" this is the qemu cmdline executed:

/usr/bin/qemu-system-x86_64 -nographic -m 1500 -smp 4 -device virtio-blk-pci,id=blk0,bootindex=0,drive=hd0 -drive file=/home/robbat/.capstan/instances/qemu/unikure/disk.qcow2,if=none,id=hd0,aio=threads,cache=none -chardev stdio,mux=on,id=stdio,signal=off -device isa-serial,chardev=stdio -netdev bridge,id=hn0,br=virbr0,helper=/usr/libexec/qemu-bridge-helper -device virtio-net-pci,netdev=hn0,id=nic1,mac=6e:48:b2:0e:48:08 -chardev socket,id=charmonitor,path=/home/robbat/.capstan/instances/qemu/unikure/osv.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control

I do not know how to set accelerator in QEMU.

thanks

roberto

Waldek Kozaczuk

unread,
Apr 17, 2019, 11:51:07 PM4/17/19
to OSv Development
Definitely you are NOT using KVM acceleration - you should see "-enable-kvm" in the cmdline.

Could you please check that you have KVM module installed and setup for your user  like so:

usermod -aG kvm <user name>

Also make sure you have this line:

disable_kvm: false

in ~/.capstan/config.yaml.

I do not remember if capstan enables KVM by default if detected or if you have to specify it explicitly. This - https://github.com/cloudius-systems/capstan/blob/efad2dff6ddeded449aa3954bcaefba554a36209/Documentation/Installation.md - says that it is enabled by default but probably only of KVM is setup.

Waldek

Roberto Battistoni

unread,
Apr 18, 2019, 2:18:41 AM4/18/19
to Waldek Kozaczuk, OSv Development
yes the problem is that KVM is not running. also with your specification it does not work…

I must investigate on the KVM installation on the host machine.

thanks a lot


To unsubscribe from this group and all its topics, send an email to osv-dev+u...@googlegroups.com.

Pekka Enberg

unread,
Apr 18, 2019, 2:22:48 AM4/18/19
to Roberto Battistoni, Waldek Kozaczuk, OSv Development
On Thu, Apr 18, 2019 at 9:18 AM Roberto Battistoni <r.batt...@gmail.com> wrote:
yes the problem is that KVM is not running. also with your specification it does not work…

I must investigate on the KVM installation on the host machine.

Look at the output of "dmesg" for clues. One common issue is that hardware virtualization is disabled in the BIOS.

- Pekka 

roberto battistoni

unread,
Apr 19, 2019, 6:25:48 AM4/19/19
to Pekka Enberg, Waldek Kozaczuk, OSv Development
KVM is installed and working in the system. I enabled all the flags that Waldek suggested but nothing...the  "-enable-kvm" is not present in the cmdline. 

The capstan version I use is the 0.30. 

Any Idea?

Roberto

robertob

unread,
May 4, 2019, 5:39:53 AM5/4/19
to OSv Development
I'm still stuck on this problem. KVM works well on the machine but the capstan runs the qemu without "-enable-kvm". Is there a way to force this parameter in capstan run?



Il giorno venerdì 19 aprile 2019 12:25:48 UTC+2, robertob ha scritto:
KVM is installed and working in the system. I enabled all the flags that Waldek suggested but nothing...the  "-enable-kvm" is not present in the cmdline. 

The capstan version I use is the 0.30. 

Any Idea?

Roberto

Il giorno gio 18 apr 2019 alle ore 08:22 Pekka Enberg  ha scritto:

Waldek Kozaczuk

unread,
May 7, 2019, 8:15:48 AM5/7/19
to OSv Development
So I double checked capstan code and here are all conditions it checks to set DisableKvm flag (https://github.com/cloudius-systems/capstan/blob/efad2dff6ddeded449aa3954bcaefba554a36209/cmd/run.go#L233):
- the 'disable_kvm' flag in ~/.capstan/config.yaml (executing 'capstan config print' will show you that) 
- the CAPSTAN_DISABLE_KVM environment variable

I betting the last check one is somehow failing. Just execute kvm-ok in command line using same user you are using to run capstan and see what it shows.

Waldek 

robertob

unread,
May 7, 2019, 8:57:57 AM5/7/19
to OSv Development
I think the problem is that on Fedora there is not "kvm-ok"...so it fails for this reason.

I could try to use the code from here:

Reply all
Reply to author
Forward
0 new messages