openwrt on kvm

Hi,

Can some one tell how install openwrt on mikroitk KVM step by step???. I downloaded images from
here: http://downloads.openwrt.org/barrier_breaker/14.07/x86/kvm_guest/
Are these images correct? which image I should use?
When I create new kvm? what are kernel, initrd, kernel cmdline???

???

What is wrong here??
add disk-images=hda:openwrt-x86-kvm_guest-rootfs-ext4.img.gz kernel=
openwrt-x86-kvm_guest-rootfs-ext4.img.gz kernel-cmdline=“console=ttys0”
memory=512MiB name=kvm5

KVM status is running, but I can not connect with console.
[admin@MikroTik] > kvm console kvm5

[Ctrl-A is the prefix key]

The problem is that you unfortunately do not understand some basic concepts. You have multiple things wrong, not just one thing wrong.

Your disk image file is compressed with gzip (.gz). Nowhere in the RouterOS KVM manual does it say that KVM supports that. I strongly suspect it does not. Don’t use a compressed image file.

Repeating the disk image file name as the boot kernel is nonsense. If you are going to populate that field, it needs to point to an actual kernel. With Xen that field was required for non-RouterOS guests and had to point to a kernel that was outside of the disk image, but I think with KVM the referenced path points to a file inside of the disk image (I am not 100% sure since I have not tried it myself; if I am wrong and it works like Xen did, you may need to extract the kernel file and the initrd file (if present) from the disk image and upload them to the router separately).

All /dev device node names are case-sensitive. First serial interface on Linux is ttyS0, not ttys0. Also, the virtual console feature will not work if your OpenWRT kernel does not have serial console support compiled into it, since KVM emulates a serial port to the guest when you use that feature. If you do not understand what this means or how to do this, then it may be easier for you to use VNC instead of the emulated serial console.

I would suggest that you play around with KVM and Linux separately from RouterOS first so that you can learn about the fundamentals, and then apply what you have learned to KVM on RouterOS.

– Nathan

I unziped it - no meter. I fixed errror S0. What can I do more?

I have no idea since I have never tried this before. However, you can probably figure it out if you use common sense and do a little research.

Like I said, if you need a kernel, you may need to extract it from the disk image.

Alternatively, I see that in the directory that you pointed us to, there is a kernel image in there: http://downloads.openwrt.org/barrier_breaker/14.07/x86/kvm_guest/openwrt-x86-kvm_guest-vmlinuz – why don’t you download that, upload it to your router, and set that as the kernel image name?

If that doesn’t work, I don’t know…I would have to set aside some time to try it myself.

– Nathan

I uploaded kernel file, writed it in kernel line, but still the same situation, KVM is running, but i cannot connect…

Dear Mikrotik support please give us normal Mikrotik KVM wiki with examples) Thanks for help.

I just tried this out for myself and it works perfectly fine. You didn’t bother to try my earlier suggestion, which was to connect to the console using VNC. If you had done so, you would have seen that it was crashing with this error on bootup:

Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I then specified kernel-cmdline=“root=/dev/sda” and it booted up without a problem.

Anyway, if you use the “combined” image instead of the “rootfs” image, it already contains the kernel inside of it (so you don’t need to upload it separately) as well as a GRUB bootloader that supplies all of the necessary kernel command-line options for you (so you don’t need to configure anything for kernel-cmdline). Literally all you do is uncompress it, upload it, and then set disk-images=hda:openwrt-x86-kvm_guest-combined-ext4.img and it “just works”.

– Nathan

currently it is not possible to virtualize guest OS on tile arch routers. It is a work in progress.???


\


We are the leading the world in providing best Testking cisco certification dumps cissp certification prep solutions. Our incredible offers for yale.edu questions. berklee.edu

I change kernel-cmdline=“root=/dev/sda” and now I can connect to openwrt. Thanks, NathanA.

I have the same problem and I tried to add “root=/dev/sda” to kernel-cmdline, but it doesn’t solve the problem.
My settings for kvm looks like:

name="kvm1" cpu-count=1 memory=128MiB disk-images=sda:openwrt.img 
     kernel="vmlinuz" kernel-cmdline="console=ttyS0, root=/dev/sda" initrd="" 
     vnc-server-address=0.0.0.0 vnc-server-display=0 snapshot=no

And error looks like:

[    0.405116] VFS: Cannot open root device "sda" or unknown-block(0,0): error -6
[    0.406402] Please append a correct "root=" boot option; here are the available partitions:
[    0.407889] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.409358] Kernel Offset: 0x0 from 0xc1000000 (relocation range: 0xc0000000-0xc87effff)
[    0.410012] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[  132.804790] random: nonblocking pool is initialized