Centos install on KVM

I copied the vmlinuz and initrd files from guest os and set up like this but it will not work.


disk-images=hda:ubuntu.img initrd=“initrd.img-2.6.31-22-generic”
kernel=“vmlinuz-2.6.31-22-generic” kernel-cmdline=“” name=“ubuntu” cpu-count=1
memory=256MiB state=no-kernel-or-initrd

I have problem with kvm…

disk-images=hda:centoss.img initrd=“initrd-2.6.18-194.el5.img”
kernel=“vmlinuz-2.6.18-194.el5” kernel-cmdline=“console=ttyS0”
name=“centos” cpu-count=1 memory=256MiB state=no-kernel-or-initrd

Hello, I’ve created RouterOS image and run Virtual machine (status running, VNC:192.168.178.12:0). Later I have added in KVM menu (I’ve installed today 5.0rc4 version of Mikrotik) VM interface (virtual machine=ubuntu, type= static, static=vif1 - I’ve created before Virtual ethernet “vif1”). As I described before status now is “running”, but I can’t connect to this VM. I’ve redirected port 5900 (udp and tcp) on address 192.168.178.12 (port 5900), but it don’t helps. I’ve used in Mikrotik tool ping 192.168.178.12 and is OK (when I’ve set “dynamic bridge” in VM interface always was “timeout”, so I’ve change to static Vm interface). Now, VNC always said to me “failed to connect: connection refused (10061)”. Later, I’ve added second interface with “dynamic bridge” connected with bridge1 - 192.168.178.1 (devices connected with bridge1 have connection with internet) and automatically it has added new interface (tap1), but also I can’t connect to Virtual Machine. Problem also is that when vif1 is 192.168.178.12, I can’t connect to other devices in network 192.168.178.x, so when I’ve change vif1 on 192.168.1.12, I can ping 192.168.1.12, but I can’t connect to Virtual Machine (I thought that tap1 connected with bridge1 help me, but don’t).
First thing I’ve done was creating routeros image “centos.img” and writing in terminal:
add name=ubuntu cpu-count=2 disk-images=cdrom:CentOS-5.5-i386-netinstall.iso,hda:centos.img initrd=“” kernel=“” kernel-cmdline=“console=ttySO” memory=1024MiB snapshot=no vnc-server=192.168.178.12 state=running
Files CentOS-5.5-i386-netinstall.iso and centos.img are present in Mikrotik files.
What should I set more? Could You help me connect to Virtual machine:)
Best regards.

for VNC try to set up port to connect to. better use values 1,2.. etc and connect to 5901, 5902 etc port.

it was not clear what interface you have set up for the VM. Check your configuration, weather there are no misconfiguration in routing/addressing, like 2 addresses from same subnet on different interfaces etc.

If you want to play around with interfaces for testing you can create virtual RouterOS and check what happens and how what looks like when you add different types on interfaces.

Hello, thank You for answer. So I’ve changed static vif1 on 192.168.1.12 and add it into interface in VM (I’ve removed tap1, dynamic bridge in VM and also from bridge1) and it’s a little better:) Also I’ve changed VNC on 192.168.1.12:1 (and redirected port 5901 from in. interface to 192.168.1.12 - now it don’t show me “vnc cant bind”). I’m tying to connect by VNC Viewer on ip:5901, but always I’ve got answer: “Connection reset by peer (10054)” - reconnecting don’t helps (I see only for a while window with VNC and name of KVM). I’ve Windows XP, antivirus is closed, firewall off and I don’t know where is problem. When I connect to other computers by VNC from my computer, connection is OK. Mayby I should add my VM in Mikrotik to bridge1 (but when I use :dynamic bridge" I don’t know on which IP, I should redirect port 5901; when I set static and write vif1=192.168.178.12, I can’t connect to other computers in network from outside). What could I do more? Best regards and thank You for help in advance.

VNC server is hosted on KVM host system, and not on KVM guest. so you do not need to redirect ports, if you can access host directly. Also, if you bind it to certain IP address - it will bind only to that one address and that one port, so it will not be accessible through other addresses.

Hello, thank You for answer. It helps me much:) I’ve change setting “vnc-server=192.168.178.12:1” on “0:0:0:0:1” and it works. Second problem was in real vnc (I’ve to set in option use “the best color” or manually adapt to lower resolution) and it start to work, but very slowly. I’ve checked various settings, but problem is always the same - very slowly working. I’ve CF card and E8400 processor ( virtualization VT is active in BIOS) mayby there is a problem? Mayby I should change on disk? Second problem is that my routeros image has capacity of 1,1GB and I don’t know which distribution of linux will work better (I need torrent client + “wine” - windows in linux). When I install Ubuntu it needs 2,4GB. Could You help me choose? Thank You once more for help:)

not sure what you mean by slow. Any Linux distribution should be fine. VNC feels a bit slower than real thing. Just try some tasks, maybe it is not that bad when you run some tasks.

Hello, it works very slowly (because refresh page last 30s, my mouse pointer go very lazy (after 15s it do what I has done on my computer, internet works inside Centos about 30kbps on connection 20MB, it could do one operation at time (open, later move pointer, close, open, write, etc as I want, but one after one, not in the same time). Mayby problem is that I can’t install Linux on my 2gb CF card (when I install, always see that linux need above 2GB partition - I’ve routerOS image 1,5GB) and I start it from iso image always. So I will try with disk later. But could You explain me which disk max. capacity Mikrotik see (750GB - 2TB) and which vendor (Seagate, WD) - I would like to install the biggest? Second, how big could be routerOS image - 60GB also? Thank You for help and best regards.

you can choose whatever vendor you like. Disk size - well, larger disk will format longer, else, it should see correct size of hard drive, that is if BIOS has no issues and is displaying drive size correctly.

Hello, thank You for answer.i understand that everything depends on my needs:) If I want 200GB RouterOS image it will also be posssible, but only format will last longer? But second problem is with disk: I’ve installed 1TB Seagate and Mikrotik don’t see it (in BIOS everything is OK - I could choose betwen 3 modes in BIOS: RAID, ATA, SATA and each mode see disk in BIOS, but Mikrotik don’t see). So I had question about capacity and vendor - mayby 1TB WD works well or mayby 2TB Seagate works OK or mayby only 750GB or 500GB. Mayby somebody have installed such a disk and help me choose? That why I had such a quetsion:) Best regards.

are you sure that this is disk that is not seen? Can you attach any other disk to the same interface and see if that is recognized?

To make sure you can add it to router known to work from sata and see how it goes.

Hello, I’ve 6 sata port on board - on each I can se 1TB Seagate disk in BIOS, but not in Mikrotik. It work on other computer (I can run it on Windows XP), but I can’t check it on other router, because I don’t have such and also I don’t have other disk to see if SATA ports are good (but to 1 port SATA is connected my CF card with Mikrotik). I will buy external enclosure and will check it by USB port (mayby then Mikrotik will see). In Mikrotik under tab “stores” my sata2 (sata1 is CF card with Mikrotik) disk is amount 0 and state “invalid”. That’s why my question was about max. capacity, mayby it’s too much:) Best regards.

RouterOS does not use file system that is widely used. And does not recognize any of them (neither VFAT nor NTFS are recognized) you have to format drive before you can use it.

Hello, thank You for answer. I’ve NTFS system on disk:) Thats’s mean that I’ve to format on FAT32 (but there will be limit of max. one file capacity to 4GB). Could I use other format? Best regards.

No, FAT32 will also not work. You have to attach the drive to the RouterOS machine, and RouterOS will format it to it’s own filesystem.

Hello, thank You for anwser, but how Mikrotik format disk if In Mikrotik under tab “stores” my sata2 (sata1 is CF card with Mikrotik) disk “total space” is 0 and state “invalid” - I understand that Mikrotik can’t see capacity of disk so Mikrotik don’t know how big partition can create or mayby I’m wrong and I should format “invalid” disk and after format it will see 1TB capacity? Best regards.

as far as i know it should see full capacity of 1TB disk. I have not tested with that capacity, but 500GB disk was displayed correctly.

Hello, after a little fight, i’ve run 1TB on my sytem and it works - I’ve to format disk with “invalid” status:) But after I’ve two new problems:

  1. I can’t unmount “cdrom:CentOS-5.5-i386-netinstall.iso” because after that i’ve one time - unsupported cpu and second time - failed, but when I add it to start, centos works - so I change places in disk-images: first “hda”, second “cdrom” and works, but why I can’t run Centos without cdrom after install?
  2. I can’t mount my 1TB disk - Centos only see disk capacity from “centos.img”, but what to do to see my 1TB disk - how to mount - I can connect with 1TB only by FTP, but I can’t save on it for example torrent files.
    Please help and happy NEW Year.

you cannot mount device from RouterOS to your host OS directly. only thing you can do is to make file and mount it as a drive to guest os.