Community discussions

MikroTik App
 
javaloka
just joined
Topic Author
Posts: 1
Joined: Thu May 24, 2007 1:38 pm

KVM guest OpenBSD 4.6

Sun Apr 11, 2010 5:28 am

Hello,

I'm trying to install KVM guest OpenBSD 4.6 on my RouterOS 4.6.
I setup the host like this:
add comment="" cpu-count=1 disabled=no disk-images=cdrom:ISO/install46.iso,hda:sata2/KVM/OpenBSD.img initrd="" kernel="" kernel-cmdline="" memory=256MiB name=OpenBSD-4.6 snapshot=no vnc-server=0.0.0.0:1
sukses installed,
i`am upload ftp file "/boot" and "/bsd"
after reboot code i change to :
add comment="" cpu-count=1 disabled=no disk-images=hda:sata2/KVM/OpenBSD.img initrd=sata2/OpenBSD/boot kernel=\
    sata2/OpenBSD/bsd kernel-cmdline="" memory=256MiB name=OpenBSD-4.6 snapshot=no vnc-server=0.0.0.0:1
can`t start : state=failed

log :

kvm,debug KRunner::command
kvm,debug KRunner::setState 2->3
kvm,debug arguments: qemu-system-x86_64 -S -net none -clock unix -serial unix:/ram/kvm-con-6.sock,server,nowait -dr
ive file=/var/pckg/sata2/KVM/OpenBSD.img,index=0,if=ide -name OpenBSD-4.6 -smp 1 -m 256 -L /nova/lib/kvm/bios/ -initrd /var/
pckg/sata2/OpenBSD/boot -kernel /var/pckg/sata2/OpenBSD/bsd -monitor unix:/ram/kvm-mon-6.sock,server,nowait -virtioconsole unix:/ram
/kvm-com-6.sock,server,nowait -vnc 0.0.0.0:1
kvm,debug Child::addChild: 1510
kvm,debug Child::sigChld
kvm,debug Child::sigChild: child died 1510 status 0x9
kvm,debug KRunner::childTerminated
kvm,error vm id:6 failed with status: 0
kvm,debug KRunner::setState 3->6
kvm,debug VInterfaceHandler::stopNetworkingForGuest
kvm,debug removing iface


what kernel and initrd fields for guest OpenBSD ?
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: KVM guest OpenBSD 4.6

Mon Apr 12, 2010 8:17 am

have not tried to run OpenBSD, but for ubuntu linux i could leave those files empty. Only change was required was remove install cdrom device.
 
yozhiks
just joined
Posts: 10
Joined: Tue Mar 01, 2011 8:38 pm

Re: KVM guest OpenBSD 4.6

Tue Mar 01, 2011 8:49 pm

have not tried to run OpenBSD, but for ubuntu linux i could leave those files empty. Only change was required was remove install cdrom device.
I've tried to install 32bit server edition of Ubuntu 9.10, 10.4LTS and 10.10 on RouterOS 5 beta. I was able to boot from CD and install, however after detaching CD-ROM image system doesn't boot. I see blank black screen and white cursor on the top left side and nothing more happens.

I also tried to install latest Slackware distro. I succeeded to install and it starts and runs without CD-ROM image. I also tried to install LILO (boot loader used in Slackware) on Ubuntu instead of Ubuntu's native GRUB2. A was able to see LILO's menu, but when I select to boot Ubuntu from menu - I get the same black screen with cursor.

Which Ubuntu version did You install?
On which RouerOS version?
Could You give me some advice what else to try to make ubuntu work in MT's KVM?

Thanx!
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: KVM guest OpenBSD 4.6

Wed Mar 02, 2011 8:35 am

i have installed Ubuntu 9.10 and 10.4 desktop version as KVM guest on RouterOS. And if you read on the forums you will see that some has installed CentOS. Also, due to versatility, or lack thereof, i would not recommend installing LILO as boot loader.
 
yozhiks
just joined
Posts: 10
Joined: Tue Mar 01, 2011 8:38 pm

Re: KVM guest OpenBSD 4.6

Wed Mar 02, 2011 1:49 pm

Just tried Ubuntu 10.4 Desktop Edition and no problem. Installed,removed CD-ROM, restarted. Works fine.
So the summary:

Slakware 13.1 - Install OK, boot OK
Ubuntu 10.4 LTS Desktop - Install OK, boot OK

Ubuntu 9.10 Server - Install OK, boot FAIL
Ubuntu 10.4 LTS Server - Install OK, boot FAIL
Ubuntu 10.10 Server - Install OK, boot FAIL (tried also with another boot loader and "*-virtual" kernel version).

The same image that fails to boot in KVM on MT boots perfectly if I download it and run it on my laptop (I have ubuntu desktop with KVM on my laptop). So the problem seems to be specific to KVM in MT.

Tried to turn on logging (kvm, debug) - i see just some lines when virtual machine starts (interface initialization, etc.), but complete silence at the moment when machine gets stuck on black screen with cursor.

Looks like Ubuntu server edition tries to do something incompatible with KVM on MT just after boot loader code (during initrd or kernel load?).

Could You please give me some advice where to dig further or how to get some additional debug data from KVM on MT?

Thanx!
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: KVM guest OpenBSD 4.6

Wed Mar 02, 2011 4:19 pm

are you monitoring boot up process form VNC or from console?

also, jave you set up initrd and kernel files in KVM guest setup? It could be problem that KVM fails to retrieve the kernel from image file and fails to boot, or loads wrong kernel/initrd
 
yozhiks
just joined
Posts: 10
Joined: Tue Mar 01, 2011 8:38 pm

Re: KVM guest OpenBSD 4.6

Wed Mar 02, 2011 6:08 pm

are you monitoring boot up process form VNC or from console?
from VNC
also, jave you set up initrd and kernel files in KVM guest setup? It could be problem that KVM fails to retrieve the kernel from image file and fails to boot, or loads wrong kernel/initrd
I've left kernel, initrd and params fields blank.
[admin@OldMain] /kvm> export
# mar/02/2011 17:55:48 by RouterOS 5.0rc10
/kvm
...
#ubuntu 10.10 server edition
add cpu-count=1 disabled=no disk-images=hda:/sata1/ubuntu.img initrd="" kernel="" kernel-cmdline="" memory=512MiB name=ubuntu snapshot=no vnc-server=172.16.16.16:1
...
#Slackware 13.1
add cpu-count=1 disabled=no disk-images=hda:sata1/slaka.img initrd="" kernel="" kernel-cmdline="" memory=512MiB name=slaka snapshot=no vnc-server=172.16.16.16:1
...
Ubuntu 10.4 Desktop
add cpu-count=1 disabled=no disk-images=hda:sata1/ubuntu-desk.img initrd="" kernel="" kernel-cmdline="" memory=512MiB \
name=ubuntu-desk snapshot=no vnc-server=172.16.16.16:1
and interfaces
/kvm interface
add disabled=no dynamic-bridge=kvm_bridge host-mac-address=02:87:46:C7:CE:CC model=virtio type=dynamic virtual-machine=\
    ubuntu vm-mac-address=02:0A:CC:4B:57:60
add disabled=no dynamic-bridge=kvm_bridge host-mac-address=02:87:97:74:FF:BC model=virtio type=dynamic virtual-machine=\
    slaka vm-mac-address=02:76:82:48:38:12
add disabled=no dynamic-bridge=kvm_bridge host-mac-address=02:D3:F4:6D:C8:C0 model=virtio type=dynamic virtual-machine=\
    ubuntu-desk vm-mac-address=02:99:82:1B:4F:83
I do not run them all simultaneously, so it's ok to have the same VNC port:ip for all of them.
I also tried to copy kernel+initrd from installation media to /file directory on MT and entered them in corresponding fields in VM devinition, but it didn't help.
 
yozhiks
just joined
Posts: 10
Joined: Tue Mar 01, 2011 8:38 pm

Re: KVM guest OpenBSD 4.6

Wed Mar 02, 2011 6:23 pm

Ok, as I see now, the only differences in what I do between trying to install in MT KVM Ubuntu 10.4LTS Server and Ubuntu 10.4LTS Desktop is different ubuntu images. Everything else is EXACTLY the same. Desktop boots normally, server fails. So the difference seems to be in Ubuntu.

Accordin to Ubuntu web site (https://help.ubuntu.com/10.04/servergui ... stall.html) the only differences that actually might influence the boot process are different kernel options:
* The Server Edition uses the Deadline I/O scheduler instead of the CFQ scheduler used by the Desktop Edition.
* Preemption is turned off in the Server Edition.
* The timer interrupt is 100 Hz in the Server Edition and 250 Hz in the Desktop Edition.

Will try to recompile kernel with these oprions as in Desktop edition and see if it works.
 
yozhiks
just joined
Posts: 10
Joined: Tue Mar 01, 2011 8:38 pm

Re: KVM guest OpenBSD 4.6

Thu Mar 03, 2011 1:04 am

Nice. After some more tests:
- Ubuntu Server distro with kernel recompiled with options like in desktop kernel - FAILS.
- Ubuntu Desktop distro with kernel recompiled with options like in server kernel - WORKS.
So the only difference seems to be X-Win and different installers.
Desktop edition works fine without X (removed x11-common and disabled gdm).
So the only thing that remains is installer.
Won't dig any further, as at this point I already can convert desktop edition to server edition by removing X and replacing kernel.

Thanx for help and hope this information will be useful for others.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: KVM guest OpenBSD 4.6

Thu Mar 03, 2011 12:45 pm

jep, thx for the posts.
 
chemil
just joined
Posts: 17
Joined: Thu Jun 23, 2011 10:33 am

Re: KVM guest OpenBSD 4.6

Tue Aug 07, 2012 2:01 pm

Is there any known solution how to safely unmount cdrom iso from KVM config of an Ubuntu server edition?

I have exactly same problem as yozhiks.

Just after I remove cdrom:ubuntu-10.04.3-server-i386.iso my Ubuntu VM is unable to start anymore. There are only couple of messages in the log "kvm error - kvm guest csrashed, restarting..."

I'm using RouterOS v5.19 on x86 and here is my KVM config:
     name="VM" cpu-count=2 memory=512MiB 
     disk-images=hda:ubuntu.img,cdrom:ubuntu-10.04.3-server-i386.iso kernel="" 
     kernel-cmdline="console=ttySO" initrd="" vnc-server-address=0.0.0.0 
     vnc-server-display=1 snapshot=no state=running
Thank you in advance for any information.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: KVM guest OpenBSD 4.6

Tue Aug 07, 2012 3:02 pm

what happens if you extract the kernel and initrd from the image and add them as a values in attributes of kvm configuration?

It might be related to different kernels and initrd that is used by RouterOS and guest OS
 
chemil
just joined
Posts: 17
Joined: Thu Jun 23, 2011 10:33 am

Re: KVM guest OpenBSD 4.6

Tue Aug 07, 2012 5:00 pm

Could you be so kind and provide me some additional instruction how to extract these parameters?

Anyway, how can be a cdrom install image related to the boot process of the VM and what exactly is behind the scene that the VM without it doesn't work completely?

I presume that kernels are different too. So that means that this particular VM will not boot with or without cdrom image if these parameters are not filled correctly. Which is not this case.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: KVM guest OpenBSD 4.6

Wed Aug 08, 2012 8:53 am

well, just get the files from /boot folder. For latest Ubuntu - vmlinuz-3.2.0-29-generic and initrd.img-3.2.0-29-generic and just upload them to router in addition to image file you have for the guest. When this is done, add path where to find these files in the router.
 
chemil
just joined
Posts: 17
Joined: Thu Jun 23, 2011 10:33 am

Re: KVM guest OpenBSD 4.6

Wed Aug 08, 2012 9:42 am

This is how my config looks like now:
     name="VM" cpu-count=2 memory=512MiB disk-images=hda:ubuntu.img 
     kernel="vmlinuz-2.6.32-33-generic-pae" kernel-cmdline="console=ttySO" 
     initrd="initrd.img-2.6.32-33-generic-pae" vnc-server-address=0.0.0.0 
     vnc-server-display=1 snapshot=no state=running 
The VM is able to start however it hangs almost immediately with "Press F12 for boot menu" at the bottom of the post screen.
 
ferywu
just joined
Posts: 22
Joined: Fri Feb 17, 2012 6:24 pm

Re: KVM guest OpenBSD 4.6

Fri Nov 23, 2012 8:08 am

All are fine using OpenBSD 5.2-beta
virtio also running great.

Who is online

Users browsing this forum: No registered users and 4 guests