Community discussions

MikroTik App
 
zentavr
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Tue Nov 05, 2013 2:11 pm

RouterOS 7.x unattended installation for x86

Sun Sep 10, 2023 4:30 am

Hello,

I have a server somewhere in the overseas office where I need to Install RouterOS 7. It has Ubuntu 22.04 currently.
I wonder if there is a method which I can use and do an unattended installation? I have no KVM there unfortunately.

I downloaded install-image-7.11.2.zip, mounted and can see:
drwxr-xr-x 3 root root     4096 Jan  1  1970 .
drwxr-xr-x 5 root root     4096 Sep  9 22:45 ..
-rwxr-xr-x 1 root root 18838424 Aug 31 14:41 1.npk
-rwxr-xr-x 1 root root        2 Aug 31 14:41 CHOOSE
drwxr-xr-x 3 root root     2048 Aug 31 14:41 EFI
-rwxr-xr-x 1 root root        2 Aug 31 14:41 autorun.scr
-r-xr-xr-x 1 root root   115180 Aug 31 14:41 ldlinux.c32
-r-xr-xr-x 1 root root    67072 Aug 31 14:41 ldlinux.sys
-rwxr-xr-x 1 root root  3365088 Aug 31 14:41 linux
-rwxr-xr-x 1 root root       80 Aug 31 14:41 syslinux.cfg

I'd populated autorun.scr file (seems like it is being used when the first boo happens). Firstly I'd tried at the test PC I have near me and when I dd the prepared image - it still wants me to press the buttons in order to finish the process.

Maybe I need to create some other answers file or to specify smth inside CHOOSE file I can see inside the image too?
Last edited by zentavr on Sun Sep 10, 2023 11:20 pm, edited 2 times in total.
 
r00t
Long time Member
Long time Member
Posts: 674
Joined: Tue Nov 28, 2017 2:14 am

Re: RouterOS 7.x unattended installation for x86

Sun Sep 10, 2023 4:31 pm

It's better to do install locally in a VM (use same size/type of virtual disk as later in real machine) then after setup finishes, shut it down and DD the disk contents to a real machine disk.
It should boot and even without any special autorun.scr it should be accessible over LAN for further configuration. Again you can test everything in a VM to see what will happen when it boots...
 
zentavr
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Tue Nov 05, 2013 2:11 pm

Re: RouterOS 7.x unattended installation for x86

Sun Sep 10, 2023 11:19 pm

It's better to do install locally in a VM (use same size/type of virtual disk as later in real machine) then after setup finishes, shut it down and DD the disk contents to a real machine disk.
It should boot and even without any special autorun.scr it should be accessible over LAN for further configuration. Again you can test everything in a VM to see what will happen when it boots...
Problem is that the overseas guys are not very technician. Right now I have an SSH port forwarding to the server which should become a router and the server should be available at the same IP address as it has now, so I really do need autorun.scr which creates me the correct configuration.
 
zentavr
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Tue Nov 05, 2013 2:11 pm

Re: RouterOS 7.x unattended installation for x86

Mon Sep 11, 2023 1:04 am

It's better to do install locally in a VM (use same size/type of virtual disk as later in real machine) then after setup finishes, shut it down and DD the disk contents to a real machine disk.
It should boot and even without any special autorun.scr it should be accessible over LAN for further configuration. Again you can test everything in a VM to see what will happen when it boots...
The interesting thing: I'd just compared the disk which I had afrer the install from install-image-7.11.2.zip (x86 distro) and chr-7.11.2.img.zip. Everything is the same (compared by the checksums), but the only file which is different is (part2)/nova/etc/serial.
 
zentavr
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Tue Nov 05, 2013 2:11 pm

Re: RouterOS 7.x unattended installation for x86

Mon Sep 11, 2023 5:26 am

It looks like the CHR image does not have anything related to the serial numbers. I'd compared first 1024 bytes of both disks and there is a serial number (10 bytes) at the offset 0x0000100 + 2 other bytes (checksum? signature?) is available at the disk which was created by the installer.
 
zentavr
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Tue Nov 05, 2013 2:11 pm

Re: RouterOS 7.x unattended installation for x86

Mon Sep 11, 2023 6:42 am

So... The MBRs of CHR and x86 differ:
1. At 0x00000100 there are 12 bytes of serial+something. 10 bytes of serial itself (the value without newline) is a hex (just text string) locates in ${ROS_DIR}/nova/etc/serial
2. At 0x00000150 CHR has 01, x68 has 00
3 At 0x000001db There are 2 bytes.. x86 has 8F08

In my case it was to patch CHR image and generate proper autorun.scr file.