How to install Mikrotik CHR on Oracle Cloud always free instance?

Hello!
Please help installing CHR or x86 image on Oracle Cloud which no longer has the ability to create custom disks/images (30 days have passed).

After the following procedure:

I am stuck at this step:
1.png
After selecting the highlighted item above (Boot Install…), the process stops on the next:
2.png
Perhaps there is another way to install on Oracle Cloud?

I hope you download the chr image to ramdisk? If not there is a possibility that you overwrite your chr image with chr image.

Hi!

Custom images are not an option for Oracle Always Free tier after the trial period expires.
So you can install the image from inside the vm.
If anyone interested, here’s a way to do it.

  1. Create instance. Under “Image and shape” choose “Rocky Linux 9.1 - Free (x86_64)”. Save Private key. Create.
  2. Open puttygen, “Load” the private key, “Save private key” as mikrotik.ppk
  3. Open putty, “Connection->SSH->Auth->Credentials”, browse for ppk on the first and private key on the second.
    Return on Session and enter rocky@(your vm’s public address) on “Host Name (or IP address)” box and open.
  4. Execute
    sudo -i
    yum install unzip
    umount -l /dev/sda1
    curl -L https://download.mikrotik.com/routeros/7.9/chr-7.9.img.zip | funzip | dd of=/dev/sda bs=1M
    sync
    reboot
    (you may need to force reboot it from the console)
  5. Firstly check the console’s firewall (Networking->Virtual cloud networks->yourvcn->Security Lists)
    and the connect through the public ip and secure RouterOS from inside.

Has anyone tried this procedure?

I did… Failed for me.

But anything more than a Linux instance is failing for me

https://youtu.be/Wlns9J9a2K8?si=_v0IAbzl7dHz75b_

This video has a solid guide, but I was still unable to get my instances working at all.

Maybe you’ll have more luck

I’m sorry that it didn’t work for you.
But I’ve done it multiple times and it does work.

The video you are referring to, needs an account that CAN upload custom images,
but when trial expires, this is not the case.

I’m actively using them and their awesome for their free-ness.
The only downside is the 50mbps network limit,
but it’s very easy to use ipsec through the console to overcome it.

How do it?

Does it really work to “lazy” umount the root of a running system and overwrite the underlying block device with dding the CHR image to it?

I have tried something similar:

mount -f -o remount,ro  /; curl -L https://download.mikrotik.com/routeros/7.9/chr-7.9.img.zip | funzip | dd of=/dev/vda bs=1M; echo s > /proc/sysrq-trigger; echo b > /proc/sysrq-trigger

in KVM on local PC, it has never booted. (While booting the CHR raw image directly works.)

Yes, although I’m no linux expert, this is the first thing I thought back then when I first tried it.
But it does work flawlessly, I’ve done it myriads of times by now.
I really wonder why you fail… I just made a quick proof video: https://youtu.be/NHSC-DRtDrY

The process do work also for the Ampere ARM64 CHR image and Oracle Linux 8!
Of course since current version (7.16rc4) the “Packages → Check installation” button says that it’s a bad image.
But the same error occurs in Hetzner ampere too, so my described process has nothing to do with it.

Hey guys. Has anyone managed to find out the reason for the error when checking the system installation? CHR ARM64 version on Oracle Cloud. I did it both ways as presented in the topics here on the forum. When I tried to use ZeroTier1, over time the system would freeze and only return after restarting the vps.
Captura de tela 2024-09-11 143050.png

I contacted the support about the problem and they are aware of the issue:
“We are aware about this issues and look forward to fixing them on upcoming RouterOS versions, unfortunately, I cannot provide a release date now.”
So we wait to do their magic, as they always do. I guess that this is not their top priority right now.

My oracle arm vm do also crash frequently, for no apparent reason and reboots by itself.
And sometimes I cannot connect to it using winbox.
But I have almost 20 docker containers running smoothly and none the less,
it’s still awesome and very usable even with these issues.

P4t. Friend, how did you manage to activate the Container on this Oracle Arm64 VM? I can only use the X86 version normally, but as it only has 1GB of Ram it is very limited, can you provide me with the necessary tips so that I can use the Container resources? I would be very grateful if you could tell me step by step. I’m also experiencing the same crashing issues with this CHR image. Hug!

Hi! Unfortunately I think I’m unable to provide a step-by-step guide, because… there are many steps! Ha!
But it’s not difficult, I’ll describe the general idea.

Firstly just a quick tip if you use Oracle Arm VM and it’s 200GB storage limit.
The routeros boot volume will be 47GB, which is the default.
Then you can create a Volume Block that is 106GB. You can mount it and use this space for your storage needs.
But leave empty 47GB! So you can create temporary χ86 VMs for backups of containers and repairs!
Or anyway just use 153GB, leave 47GB empty so you can create temporary vms at will!
Also another tip, increase volume performance for both Boot and Block volumes,
because the bandwidth is very high for the slow default setting of the drives.

Credits for the procedure to nescafe2002 in this post http://forum.mikrotik.com/t/v7-15rc-testing-is-released/175351/151
Beware, the following procedure is needed ONLY because of the current routeros chr arm64 cannot enable containers with the documented procedure!
When they solve this problem, the following procedure will be deprecated!

As in Oracle Cloud there is no rescue mode, the idea is to get a rosmode.msg file from an x86 chr with enabled containers
and copy it to the arm64 chr, using an intermediate x86 linux vm:

  1. Create a x86 vm (vm1), install routeros and enable containers as described in the documentation.
    (we do this just to get the rosmode.msg file. I’m not sure I can share it, I don’t want to violate any rules.)
  2. Create another x86 vm (vm2) with whatever linux.
  3. Shutdown vm1 and disconnect Boot Volume.
  4. Connect vm1 Boot Volume as a Block Volume in vm2.
  5. SSH to vm2 and do an lsblk to find the entries, and mount the Block Volume to some directory.
  6. Then use WinSCP and connect to vm2. The procedure is like putty, you put the keys and use shell “sudo su -”
    (I cannot recall, if it doesn’t let you connect with the ppk, then just set a password to root user with “passwd” command in the previous step)
  7. Navigate to the mounted directory and copy to your local disk the file rosmode.msg.
  8. Unmount the drive, disconnect the Block Volume, and you can delete vm1.
  9. Create the arm64 vm (vm3) and install routeros and don’t forget to install containers package too afterwards.
  10. Shut it down, disconnect Boot Volume and repeat steps 4 - 6.
  11. Copy the rosmode.msg you copied from vm1 file back from your local storage to the mounted volume.
    It replaces the file and keeps the same permissions.
  12. Unmount the drive, disconnect the Block Volume and connect it back as a Boot Volume to vm3.
  13. You’re done, you can delete vm2. You have a working ampere arm64 chr with containers enabled.

Hope you’ll succeed, it’s not that difficult and it’s working flawlessly! I’ve even run an LLM container… in a router! Awesome!

Hi. How you create instances with BIOS and not UEFI?

Hello everyone. I was able to install CHR on x86 Oracle. Here is instruction for whose, who can’t use custom images and limited with UEFI. I found this amazing project https://github.com/alecthw/mikrotik-routeros-chr-efi, so everything you need is to download release from this repo or, already unzipped version from my server:

umount -l /dev/sda1
curl -L *************************** | dd of=/dev/sda bs=1M
sync
reboot

After reboot, you can connect via WinBox and update ROS Package

Why BIOS? Routeros CHR and x86 is UEFI friendly for quite sometime.
All my installations in Oracle are in UEFI with secure boot disabled.
But I also have an x86 installation even with secure boot enabled, without any problem.
I’ve seen this project on github, but I never figured out why it’s needed…

It depends on what hardware (real or virtual) you run the image on.
Since several releases the image Mikrotik provides is not fully compliant with UEFI because the “system partition” is formatted as ext2fs (instead of the standard FAT).
Some machines (real or virtual) may have a firmware capable of accessing ext2FS, but most have it not.
Additionally latest few releases (post 7.14.3) have also been incorrectly partitioned (which again might or might not be an issue when booting, depending on the UEFI firmware of the machine).
That github resource aims to provide fix to the images that should be able to run everywhere, but it is partial and outdated, a more current resource is here:
https://github.com/tikoci/fat-chr
with details on this thread:
http://forum.mikrotik.com/t/router-os-7-on-uefi/156661/1