Community discussions

MikroTik App
 
th0massin0
Member Candidate
Member Candidate
Topic Author
Posts: 156
Joined: Sun May 11, 2014 4:16 am
Location: Poland

CHR on OVH VPS SSD

Wed Apr 05, 2017 7:50 am

0. RouterOS >= 6.42rc52
1. Boot VPS to rescue mode from OVH panel.
2. Login via ssh.
3. Execute this TWO lines:

v7.6
cd /root && curl -O https://download.mikrotik.com/routeros/7.6/chr-7.6.img.zip && gunzip -S .zip chr-7.6.img.zip && umount /mnt/sdb1
dd if=/root/chr-7.6.img of=/dev/sdb

v6.48.6
cd /root && curl -O https://download.mikrotik.com/routeros/6.48.6/chr-6.48.6.img.zip && gunzip -S .zip chr-6.48.6.img.zip && umount /mnt/sdb1
dd if=/root/chr-6.48.6.img of=/dev/sdb

4. Reboot from OVH panel, done!
Last edited by th0massin0 on Mon Oct 31, 2022 4:36 pm, edited 16 times in total.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: CHR on OVH VPS SSD

Fri Apr 14, 2017 5:37 pm

Have you tried to dd already installed image from some other VM?
 
th0massin0
Member Candidate
Member Candidate
Topic Author
Posts: 156
Joined: Sun May 11, 2014 4:16 am
Location: Poland

Re: CHR on OVH VPS SSD

Tue Apr 18, 2017 9:41 pm

Thank you for your answer. Even if it would work, that configuration will be unsupported, so if something will goes wrong, nobody could help me with it.
CHR is relatively young product that should be 'polished' in the matter of compatibility (in my opinion open vm tools and drivers). Today the general-use distros offers better compatibility with vm enviorment than specialized cloud mikrotik solution.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: CHR on OVH VPS SSD

Tue Apr 18, 2017 10:27 pm

Unsupported by whom? OVH won't support any CHR installation, I think. MikroTik doesn't care - it's just like moving the disk to another machine. If it works - you're just lucky.
 
User avatar
roulyz
Trainer
Trainer
Posts: 11
Joined: Sun Jul 17, 2016 1:00 am
Location: Ivory Coast
Contact:

Re: CHR on OVH VPS SSD

Sun May 21, 2017 1:52 pm

Just run this command.
PS : check your interface name before apply. here the interface name is : "ens3". Change according yours :D

wget https://download2.mikrotik.com/routeros ... .1.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
mount -o loop,offset=33554944 chr.img /mnt && \
ADDRESS=`ip addr show ens3 | grep global | cut -d' ' -f 6 | head -n 1` && \
GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \
echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1]
/ip route add gateway=$GATEWAY
" > /mnt/rw/autorun.scr && \
umount /mnt && \
echo u > /proc/sysrq-trigger && \
dd if=chr.img bs=1024 of=/dev/vda
 
th0massin0
Member Candidate
Member Candidate
Topic Author
Posts: 156
Joined: Sun May 11, 2014 4:16 am
Location: Poland

Re: CHR on OVH VPS SSD

Fri Jun 16, 2017 12:40 pm

Just run this command.
PS : check your interface name before apply. here the interface name is : "ens3". Change according yours :D

wget https://download2.mikrotik.com/routeros ... .1.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
mount -o loop,offset=33554944 chr.img /mnt && \
ADDRESS=`ip addr show ens3 | grep global | cut -d' ' -f 6 | head -n 1` && \
GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \
echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1]
/ip route add gateway=$GATEWAY
" > /mnt/rw/autorun.scr && \
umount /mnt && \
echo u > /proc/sysrq-trigger && \
dd if=chr.img bs=1024 of=/dev/vda
Could you tell me what is the purpose of that manual? The problem is lack of (v)hard disk controller driver.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: CHR on OVH VPS SSD

Fri Jun 16, 2017 12:57 pm

So, it lacks the driver in whole RouterOS or only in CHR Image Installer?
 
savage
Forum Guru
Forum Guru
Posts: 1265
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: CHR on OVH VPS SSD

Fri Jun 16, 2017 10:46 pm

There has been some posts floating around on the forum about converting the IDE disk to SCSI, and making it work that way with a few more different type of setups.

search a bit, perhaps theyll work for you :)
 
drbunsen
newbie
Posts: 40
Joined: Fri Apr 29, 2016 7:24 pm

Re: CHR on OVH VPS SSD

Thu Oct 19, 2017 4:15 pm

Some time ago I've tried to install CHR on a Hetzner VPS, unfortunately I ran into exactly the same issue.
It would be nice if Mikrotik could support virtio SCSI storage controllers as well.
 
Wencey
just joined
Posts: 4
Joined: Sat Oct 14, 2017 9:42 pm

Re: CHR on OVH VPS SSD

Thu Nov 02, 2017 6:56 am

i use bandwagon and i meet the same issue.
 
raffav
Member
Member
Posts: 345
Joined: Wed Oct 24, 2012 4:40 am

Re: CHR on OVH VPS SSD

Thu Feb 01, 2018 12:33 am

Hello
I am trying to install CHR on VPS OVH SSD from raw image (recovery mode and dd).
cd /root
curl -O http://download2.mikrotik.com/routeros/6.38.5/chr-6.38.5.img.zip
gunzip -S .zip chr-6.38.5.img.zip
umount /mnt/sdb1
dd if=/root/chr-6.38.5.img of=/dev/sdb

After reboot RouterOS won't boot. I attach screen from console. Aprox. one year ago OVH config was able to run CHR, today is not.
I am aware that some kind of VirtIO problems was fixed in 6.31, but please keep in mind, that I am trying to use 6.38.5.
Please help

PS: Info about SCSI controller from lspci:
00:04.0 SCSI storage controller: Red Hat, Inc Virtio SCSI
        Subsystem: Red Hat, Inc Device 0008
        Physical Slot: 4
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at c000 [size=64]
        Region 1: Memory at febd2000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [40] MSI-X: Enable+ Count=4 Masked-
                Vector table: BAR=1 offset=00000000
                PBA: BAR=1 offset=00000800
        Kernel driver in use: virtio-pci
        Kernel modules: virtio_pci
Simillar problem:
viewtopic.php?t=99793
viewtopic.php?t=104948


Update:
I've prabobly found main couse of the failure. Error occurs only when guest disk bus type is set to SCSI (<target dev='sda' bus='scsi'/>).
Settings that works: VirtIO, IDE, SATA.


Update (2), news from Mikrotik support:
RouterOS does not support SCSI disk installation(..)

Update (3), news from OVH Support:
There are no possibility to change VPS config, nor buy VPS from older region.



Dear Mikrotik Developers, could you please fix this?
In case of OVH VPS SSD (and many more budget VPSes) it's impossible to modify guest config details.


Edit: another request, viewtopic.php?f=15&t=124905&p=626094#p626094

hi
i think ramnode support ide driver
look at attachments
Untitled.png
You do not have the required permissions to view the files attached to this post.
 
th0massin0
Member Candidate
Member Candidate
Topic Author
Posts: 156
Joined: Sun May 11, 2014 4:16 am
Location: Poland

Re: CHR on OVH VPS SSD

Thu Feb 01, 2018 12:34 am

Looks promissing. Thank you!
 
raffav
Member
Member
Posts: 345
Joined: Wed Oct 24, 2012 4:40 am

Re: CHR on OVH VPS SSD

Thu Feb 01, 2018 4:14 am

Looks promissing. Thank you!
Hi,
Do you know if is possible to try this on openvps instead of kvm?
Because in ramnode there is a vpz small one that cost 15 dollars yearly, very cheap
@th0massin0
Edited
DIT

worked thanks allot
Untitled.png
Enviado de meu XT1580 usando Tapatalk
You do not have the required permissions to view the files attached to this post.
 
th0massin0
Member Candidate
Member Candidate
Topic Author
Posts: 156
Joined: Sun May 11, 2014 4:16 am
Location: Poland

Re: CHR on OVH VPS SSD

Sat Feb 03, 2018 1:25 am

CHR can run only in full virtualization like vmware, kvm, xen or hyper-v
 
raffav
Member
Member
Posts: 345
Joined: Wed Oct 24, 2012 4:40 am

Re: CHR on OVH VPS SSD

Sat Feb 03, 2018 1:06 pm

CHR can run only in full virtualization like vmware, kvm, xen or hyper-v
Was a little pain in the ass to find a Linux on the ramnode repository that work smoth in 512mb and since I don't have skills on Linux I need to do some research how formart a disk via command line,
After some live cd crash, freezes i maked work



Enviado de meu XT1580 usando Tapatalk

 
odvolk
just joined
Posts: 1
Joined: Thu Feb 15, 2018 1:25 pm

Re: CHR on OVH VPS SSD

Thu Feb 15, 2018 1:29 pm

Was a little pain in the ass to find a Linux on the ramnode repository that work smoth in 512mb and since I don't have skills on Linux I need to do some research how formart a disk via command line,
After some live cd crash, freezes i maked work
Hi! I wanted to know how could you manage with this? Can you bring some instructions on this? We bought an "VPS 2016 SSD 1" @ OVH.com and we are suffering some ass f***k with their system. Please, help us
 
dadag90
just joined
Posts: 10
Joined: Thu Sep 21, 2017 10:00 am

Re: CHR on OVH VPS SSD

Tue Jul 31, 2018 8:15 am

0. RouterOS >= 6.42rc52
1. Boot VPS to rescue mode from OVH panel.
2. Login via ssh.
3. Execute this TWO lines:
cd /root && curl -O https://download2.mikrotik.com/routeros/6.42.3/chr-6.42.3.img.zip && gunzip -S .zip chr-6.42.3.img.zip && umount /mnt/sdb1
dd if=/root/chr-6.42.3.img of=/dev/sdb
4. Reboot from OVH panel, done!
I install CHR yesterday (30.07.2018). I must change sdb into vdb
cd /root && curl -O https://download2.mikrotik.com/routeros/6.42.3/chr-6.42.3.img.zip && gunzip -S .zip chr-6.42.3.img.zip && umount /mnt/vdb1
dd if=/root/chr-6.42.3.img of=/dev/vdb
 
inframe
just joined
Posts: 10
Joined: Tue May 13, 2014 10:20 am

Re: CHR on OVH VPS SSD

Wed Aug 08, 2018 7:50 pm

how to update this CHR to the new version?
 
drbunsen
newbie
Posts: 40
Joined: Fri Apr 29, 2016 7:24 pm

Re: CHR on OVH VPS SSD

Wed Aug 08, 2018 9:15 pm

Update is as with any other Mikrotik device. Upload the image (x86 for CHR) and reboot.
 
inframe
just joined
Posts: 10
Joined: Tue May 13, 2014 10:20 am

Re: CHR on OVH VPS SSD

Wed Aug 08, 2018 11:45 pm

Update is as with any other Mikrotik device. Upload the image (x86 for CHR) and reboot.
Thank you! Download image x86 and updated my CHR :roll:
 
User avatar
Joni
Member Candidate
Member Candidate
Posts: 157
Joined: Fri Mar 20, 2015 2:46 pm
Contact:

Re: CHR on OVH VPS SSD

Fri Aug 31, 2018 4:21 pm

cd /root && curl -O https://download2.mikrotik.com/routeros/6.42.3/chr-6.42.3.img.zip && gunzip -S .zip chr-6.42.3.img.zip
dd if=/root/chr-6.42.3.img of=/dev/sda
Tried this on Hetzner dedicated (bare metal, EX series, I know bm isn't officially supported) however everything except routing (public ip subnets, ie forwarding) work, at least I can't get it working with any config. Sort of sad. (neither 6.40.9 (Bugfix only) or 6.42.7 (Current) or 6.43rc66 (Release candidate))
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: CHR on OVH VPS SSD

Fri Aug 31, 2018 5:41 pm

Please open a new topic and describe what exactly does not work. It's either working completely or not. It cannot 'disable routing for some unknown reason'. Where do you get your "public subnets"? Can't Hetzner block unknown IPs by default (it should, I hope)?
 
User avatar
Joni
Member Candidate
Member Candidate
Posts: 157
Joined: Fri Mar 20, 2015 2:46 pm
Contact:

Re: CHR on OVH VPS SSD

Fri Aug 31, 2018 8:23 pm

 
LisSKin
just joined
Posts: 1
Joined: Thu Jul 29, 2021 2:15 pm

Re: CHR on OVH VPS SSD

Tue Sep 14, 2021 12:03 pm

I tried to dd already installed image from another VM, but it didn't helped
 
agmltd
just joined
Posts: 2
Joined: Thu Nov 17, 2022 5:25 pm

Re: CHR on OVH VPS SSD

Fri Nov 08, 2024 12:30 pm

I'm years late to this party, but please note that you will probably need to disable Loop Protection and Spanning Tree Protocol on the interfaces facing the datacentre infrastructure. They will likely auto-block the MikroTik for a set time period and probably require a port cycle before coming back up. Note, for example if I disabled Loop Protection and Spanning Tree Protocol I would probably need to cycle the port and wait 5 minutes before it would start working.

I hope this helps some of you when you see it as not working.
 
User avatar
Steveocee
Forum Guru
Forum Guru
Posts: 1178
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK
Contact:

Re: CHR on OVH VPS SSD

Sat Nov 09, 2024 10:46 pm

Does this work? I have an OVH vps spare and could make use of this but could swear I've tried this without success.
 
wrkq
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Mon Jul 29, 2019 10:59 pm

Re: CHR on OVH VPS SSD

Mon Nov 11, 2024 3:25 pm

Does this work? I have an OVH vps spare and could make use of this but could swear I've tried this without success.
... admittedly I can't remember if I followed those particular instructions, but I did successfully deploy on the lowest-end OVH VPS (value-1-2-40) about a year ago.

basically:
1. order a VPS, I went for debian as that's my usual, wait for it to be provisioned
2. if you care for ipv6, note it down because ovh's issuing them as static config to the predeployed linux via the cloud-init tooling (ipv4 is dhcp)
3. boot to rescue mode, open the kvm web console
4. /dev/sda should be the rescueOS-disk, /dev/sdb should be your VPS persistent disk, check with cfdisk for example
5. just in case, zeroize: dd if=/dev/zero of=/dev/sdb
6. wget the CHR image to /tmp, unpack, dd over
7. just in case, sync
8. exit rescue mode using the control panel (don't just reboot the rescue OS from console)
9. CHR should boot, automatically resize to take advantage of the full size of your VPS disk, then reboot again
10. turbo log in and set a password before the first botnet scanner finds telnet + ssh naked open and moves in

I successfully got one running on Linode as well, the trick over there is that the default boot config assumes disk images are raw filesystems while kernel is fed from host.
So you need "Select Kernel: Direct Disk" and disable all of the "boot helpers" at far bottom of the VPS bootconfig page.
On the upside, you can make the first boot with ethernet "unplugged" to not worry about racing the bots for first login.
 
User avatar
Steveocee
Forum Guru
Forum Guru
Posts: 1178
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK
Contact:

Re: CHR on OVH VPS SSD

Wed Nov 20, 2024 8:19 pm

So for anyone interested it looks like this doesn’t work any more. You can DD the image over but it won’t boot. Just get a no OS found error.
 
wrkq
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Mon Jul 29, 2019 10:59 pm

Re: CHR on OVH VPS SSD

Fri Nov 22, 2024 7:37 pm

Well... maybe let me guide you step by step then?

I just went to ovh, picked up their current black friday "Value" sale, one step above "Starter".
Lists as "1 vCore / 2GB RAM / 40 GB SSD NVMe / 250 Mbps" with a lot of asterisks. Debian 12 as my usual, because you can't say "no OS, please".
After going through all the upselling and ovh-typical frustrating wait for provisioning, the VPS was there. "Model: VPS vps2020-value-1-2-40".

Clicked the three dots under "Boot" heading, "Reboot in rescue mode". Once again, frustrating of wait.
Clicked three dots under "Name" heading, "KVM".
Used the IP/password displayed on the rescue console to connect in via SSH.
[RESCUE] root@vps-xxxxxxxx:~ $ cat /proc/mounts
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=959232k,nr_inodes=239808,mode=755,inode64 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,size=196528k,mode=755,inode64 0 0
/dev/sda1 / ext4 rw,relatime,discard,errors=remount-ro 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,inode64 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k,inode64 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12798 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
ramfs /run/credentials/systemd-sysctl.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-sysusers.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-tmpfiles-setup-dev.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-tmpfiles-setup.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
[RESCUE] root@vps-xxxxxxxx:~ $ dmesg | grep -e 'sd[ab]'
[    1.854823] sd 2:0:0:1: [sdb] 83886080 512-byte logical blocks: (42.9 GB/40.0 GiB)
[    1.854839] sd 2:0:0:0: [sda] 6144000 512-byte logical blocks: (3.15 GB/2.93 GiB)
[    1.854871] sd 2:0:0:0: [sda] Write Protect is off
[    1.854873] sd 2:0:0:0: [sda] Mode Sense: 63 00 00 08
[    1.854881] sd 2:0:0:1: [sdb] Write Protect is off
[    1.854882] sd 2:0:0:1: [sdb] Mode Sense: 63 00 00 08
[    1.855207] sd 2:0:0:1: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.855256] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.856573]  sda: sda1
[    1.856692] sd 2:0:0:0: [sda] Attached SCSI disk
[    1.858396]  sdb: sdb1 sdb14 sdb15
[    1.858587] sd 2:0:0:1: [sdb] Attached SCSI disk
[    2.344029] EXT4-fs (sda1): mounted filesystem with ordered data mode. Quota mode: none.
[    3.170151] EXT4-fs (sda1): re-mounted. Quota mode: none.
[RESCUE] root@vps-xxxxxxxx:~ $
In rescue mode, /dev/sda is temp/throwaway disk with the rescue linux, /dev/sdb is your VPS's persistent disk.
It comes pre-partitioned like this:
[RESCUE] root@vps-xxxxxxxx:~ $ fdisk -l /dev/sdb
Disk /dev/sdb: 40 GiB, 42949672960 bytes, 83886080 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 999A3CBF-CB61-9F43-9EB1-2590F7B73A7D

Device      Start      End  Sectors  Size Type
/dev/sdb1  262144 83886046 83623903 39.9G Linux root (x86-64)
/dev/sdb14   2048     8191     6144    3M BIOS boot
/dev/sdb15   8192   262143   253952  124M EFI System

Partition table entries are not in disk order.
[RESCUE] root@vps-xxxxxxxx:~ $
Let's zero it out...
[RESCUE] root@vps-xxxxxxxx:~ $ dd if=/dev/zero of=/dev/sdb bs=1M count=1024 status=progress
1071644672 bytes (1.1 GB, 1022 MiB) copied, 3 s, 357 MB/s
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 3.30095 s, 325 MB/s
[RESCUE] root@vps-xxxxxxxx:~ $ fdisk -l /dev/sdb
Disk /dev/sdb: 40 GiB, 42949672960 bytes, 83886080 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[RESCUE] root@vps-xxxxxxxx:~ $
Download and unpack the CHR .img...
[RESCUE] root@vps-xxxxxxxx:~ $ apt install unzip
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  zip
The following NEW packages will be installed:
  unzip
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 166 kB of archives.
After this operation, 388 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 unzip amd64 6.0-28 [166 kB]
Fetched 166 kB in 0s (6,654 kB/s)
Selecting previously unselected package unzip.
(Reading database ... 46775 files and directories currently installed.)
Preparing to unpack .../unzip_6.0-28_amd64.deb ...
Unpacking unzip (6.0-28) ...
Setting up unzip (6.0-28) ...
[RESCUE] root@vps-xxxxxxxx:~ $ wget https://download.mikrotik.com/routeros/7.16.1/chr-7.16.1.img.zip
--2024-11-22 17:03:53--  https://download.mikrotik.com/routeros/7.16.1/chr-7.16.1.img.zip
Resolving download.mikrotik.com (download.mikrotik.com)... 2a02:610:7501:3000::251, 159.148.147.251
Connecting to download.mikrotik.com (download.mikrotik.com)|2a02:610:7501:3000::251|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 40319518 (38M) [application/zip]
Saving to: ‘chr-7.16.1.img.zip’

chr-7.16.1.img.zip               100%[==========================================================>]  38.45M  2.48MB/s    in 16s

2024-11-22 17:04:09 (2.46 MB/s) - ‘chr-7.16.1.img.zip’ saved [40319518/40319518]
[RESCUE] root@vps-xxxxxxxx:~ $ unzip chr-7.16.1.img.zip
Archive:  chr-7.16.1.img.zip
  inflating: chr-7.16.1.img
[RESCUE] root@vps-xxxxxxxx:~ $
Write it to disk...
[RESCUE] root@vps-xxxxxxxx:~ $ dd if=chr-7.16.1.img of=/dev/sdb bs=1M status=progress
128+0 records in
128+0 records out
134217728 bytes (134 MB, 128 MiB) copied, 0.323675 s, 415 MB/s
[RESCUE] root@vps-xxxxxxxx:~ $ fdisk -l /dev/sdb
Disk /dev/sdb: 40 GiB, 42949672960 bytes, 83886080 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start    End Sectors Size Id Type
/dev/sdb1  *       34  65569   65536  32M 83 Linux
/dev/sdb2       65570 258047  192478  94M 83 Linux
[RESCUE] root@vps-xxxxxxxx:~ $
Make sure everything is committed to disk (yes, unnecessary superstition...)
[RESCUE] root@vps-xxxxxxxx:~ $ sync
[RESCUE] root@vps-xxxxxxxx:~ $ sync
[RESCUE] root@vps-xxxxxxxx:~ $ reboot
and then because it reboots back into rescue, close the KVM window and go to OVH control panel. You may need to refresh the page.

"Boot" header, "Reboot my VPS", confirm, and then keep repeating the "three dots next to name -> KVM" menu until the KVM connects.

If you will be quick enough you'll even catch the QEMU BIOS and then Mikrotik bootloader messages, with the CHR auto-resizing itself from 128MB to 40GB on first boot.

Soon you will reach a "MikroTik Login:" prompt, immediately type "admin" and empty password.
If it doesn't seem to take your keyboard, click into the KVM screen first.

It will freeze for a few seconds because ROS is still initializing, then will ask if you want to see the license (say N to skip!) and then ask you to set new password.
Set a new password better than 1234 instantly, but you must rush it so maybe don't make it 40 characters super complex yet!

Then you'll be dumped into the main shell and "system, critical, login failed for admin via ssh" and "... via api" will almost for sure be already spamming your screen because bots are just /that/ aggressive.

Do /int/eth/disab ether1 to stop that, then check /user/active/print and /log/print for any hints that something else than yourself successfully connected.
("You" will be visible in /user/active/print as "VIA: console", and in /log/print as "... user admin logged in via local".)

If yes, uh, honestly, reboot back to rescue, erase the full disk (skip the count= parameter when dd'ing from /dev/zero) and try again. Let's not risk it.

If it seems you won the race, do some very basic initial securing/setup - disable web/api/etc that you don't need, set up two basic firewall rules to drop everything than your own IP, then reenable ether1 and connect via ssh or winbox to continue with a bit more comfort.

To summarize - all you need to run in rescue mode should be:
dd if=/dev/zero of=/dev/sdb bs=1M count=1024
apt install unzip
wget https://download.mikrotik.com/routeros/7.16.1/chr-7.16.1.img.zip
unzip chr-7.16.1.img.zip
dd if=chr-7.16.1.img of=/dev/sdb bs=1M
sync
and then you reboot into your fresh CHR and race against the hackbots.

If you still can't succeed to make it work - please boot into OVH rescue mode and give me output of:
fdisk -l /dev/sda
fdisk -l /dev/sdb
dmesg
please.

G'luck.
 
User avatar
Steveocee
Forum Guru
Forum Guru
Posts: 1178
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK
Contact:

Re: CHR on OVH VPS SSD

Wed Nov 27, 2024 10:47 pm

<All of this>
You genius! Worked perfect first time. Thank you so much!
 
wrkq
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Mon Jul 29, 2019 10:59 pm

Re: CHR on OVH VPS SSD

Thu Nov 28, 2024 8:27 pm

Welcome. :)

Who is online

Users browsing this forum: No registered users and 3 guests