Pages

Wednesday, May 1, 2013

Installing Mikrotik RouterOS under VirtualBox

MikroTik RouterOS is a Linux based operating system that runs on proprietary hardware (RouterBOARD), or on standard x86-based computers. Some training videos here.

You can install it in VirtualBox and play around with this virtual device.

For real hands on experience with Mikrotiks , better buy the actual equipment since they are cheap.

Go to their website and download the latest Router OS for PC/86
At this time v5.18 is latest stable available version. Also available in torrent.

Create a new Virtual Machine in VirtualBox as per example below.



Use recommended memory size of 256 MB 





Size of Virtual drive can be 512 MB






The trick here is to move the existing just created VDI image (under SATA) to IDE and load the ISO file as well. See below the steps  and screenshots in detail.
  1. Go to the VM just created and Storage -> Controllers: SATA 
  2. Click on the *.vdi file and on your right and under Information note the Location of the file.
  3. Remove the *.vdi attached under SATA.
  4. Then go to Storage -> Controllers: IDE and add a new Hard Disk ( right icon)  and choose existing Disk.  
  5. Go to  the Location you noted above and load the VDI image.
  6. Go to Storage -> Controllers: IDE -> Empty and from the Attributes on the right load the RouterOS ISO .

The screenshots below can assist you to follow the steps above.

Goto Storage Tree, SATA controller

Move the vdi image from SATA to IDE


Load the RouterOS ISO on the CD


Start the virtual machine just created and Install the basic modules.




Remove the ISO image and start RouterOS virtual machine




Another trick you can do , if you need more devices for temporary testing, is to create a master virtual machine. Then create full clones of that machine. Never start the master machine so that remaining time does not change.


Few more tips:
Use VBoxHeadless and Remote Desktop
First you make sure that you have enabled the server on Remote Display. Default port is 3389.



Close VirtualBox and start the RouterOS VM needed from CLI, then access it using Remote desktop. Example :


 $ VBoxManage startvm "Mikrotik-RouterOS-1" --type headless


 $ rdesktop 127.0.0.1


Or start the VM from VirtualBox




Use the fully cloned VM and start the machine .
Now you can use CLI to enter any commands . 

Try the following commands to see the MAC and enable dhcp client on ether1 port.
interface ethernet print
ip dhcp-client add interface=ether1 disabled=no  





 Or you can install winbox under Linux using WINE. Make sure you have correct permissions (see below)

$ ls -al winbox.exe
-rwxr-xr-x 1 stelios stelios 114176 Jun 11  2013 winbox.exe

$ wine winbox.exe  

And search for the RouterOS (under VirtualBox) MAC address (shown above)








Also, once you have an IP address on the mikrotik you can use a browser too.


Check also my next post Basic RouterOS under VirtualBox .

More posts will follow with Advance setup of RouterOS 

14 comments:

Nash M S said...

Hi.. how to use winbox with this virtualbox?

Nash M S said...

and .. how to access using browser?

Stelios Agapiou said...

Hi Nash,
I updated this post with steps on how to access with winbox as well as using a browser.

Parbat Devakota said...

plz can u post video this configuration?

Stelios Agapiou said...

Hi Parbat,
sorry I don't have a video.

Rmd said...

Hi Nash,
Complete noob here. How do I get winbox to work in the virtual machine?

Stelios Agapiou said...

Hi Rmd,

Why would you need to install winbox in the Virtual Machine(VM)?

If you mean the same VM that you have RouterOS then there is no reason.
If you mean another VM instance and I suppose you would have Windows, then it is easy. Create another Virtual Machine and install Windows. While you are in windows install winbox.
Then while you have both VMs (RouterOS, windows) running, start Winbox. Have not tried it my self but it should work.

BTW I updated my post and I clarify that you can install winbox in the host machine ( Linux). Just download winbox.exe (from Mikrotik side http://download2.mikrotik.com/winbox.exe) and run it using WINE , see below the command (make sure you have correct permissions)
$ wine winbox.exe

Nash M S said...

Try execute "ipconfig /all"

The virtualbox will give you this ip 192.168.56.1 to access.

gio chumbo said...

pass and login
write please

Stelios Agapiou said...

Hi Gio,
If you are asking about the username and password for the Mikrotik then you can use what ever you want.
See their website for default credentials - http://wiki.mikrotik.com/wiki/Manual:First_time_startup

gio chumbo said...

thanks

Oghenetega Osalor said...

nice work! its been very helpful.

Web Designing Training in Chennai said...

Remember not to leave all three routers with default configuration. Change them to numbers wich will be easy to "spy".
For tests set for the first router LAN @ subnet 172.16.x.x LAN, for the second 10.y.y.y subnet and the third (the "Internet" one) could be left @ 192.168.88.0/24 subnet. It will be easy then to see packet flow and set rules. Web Designing Training in Chennai |
Web Designing Training in Chennai

Stelios Agapiou said...

Hi Uma,
thanks.