#!/bin/bash
wget --no-check-certificate https://download.mikrotik.com/routeros/7.3beta40/chr-7.3beta40.img.zip -O /tmp/chr.img.zip
unzip -p /tmp/chr.img.zip > /tmp/chr.img
rm -rf chr.qcow2
qemu-img convert -f raw -O qcow2 /tmp/chr.img chr.qcow2
rm -rf /tmp/chr.im*
modprobe nbd
qemu-nbd -c /dev/nbd0 chr.qcow2
rm -rf /tmp/tmp*
mkdir /tmp/tmpmount/
mkdir /tmp/tmpefipart/
mount /dev/nbd0p1 /tmp/tmpmount/
rsync -a /tmp/tmpmount/ /tmp/tmpefipart/
umount /dev/nbd0p1
mkfs -t fat /dev/nbd0p1
mount /dev/nbd0p1 /tmp/tmpmount/
rsync -a /tmp/tmpefipart/ /tmp/tmpmount/
umount /dev/nbd0p1
rm -rf /tmp/tmp*
(
echo 2 # use GPT
echo t # change partition code
echo 1 # select first partition
echo 8300 # change code to Linux filesystem 8300
echo r # Recovery/transformation
echo h # Hybrid MBR
echo 1 2 # partitions added to the hybrid MBR
echo n # Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N)
echo # Enter an MBR hex code (default 83)
echo y # Set the bootable flag? (Y/N)
echo # Enter an MBR hex code (default 83)
echo n # Set the bootable flag? (Y/N)
echo n # Unused partition space(s) found. Use one to protect more partitions? (Y/N)
echo w # write changes to disk
echo y # confirm
) | gdisk /dev/nbd0
qemu-nbd -d /dev/nbd0
echo "script finished, created file chr.qcow2"
qemu-img convert -f qcow2 -O vhdx chr.qcow2 chr.vhdx
+1@kriszos: thanks for a good piece of engineering, it's a keeper!
the original solution.I experienced same problem.
It is easy to just instalI RouterOS 7 x86 from iso on uefi capable virtual machine but I wanted to boot use CHR v7 as LXD virtual machine.
It seems that CHR has everything needed to boot via uefi, but its partition table is some kind of Frankenstein between GPT and MBR. Also partition that has efi files on it is formatted as ext2 so it is not in line with UEFI standard which require that EFI files are stored on FAT/16/32 partition. Bellow is a script to correct this issues. I was able to boot it on LXD, qemu/KVM and hyper-v gen2 via uefi. Secure boot is not possible, efi file is not signed by Microsoft.
My script require that you have linux with installed following packages so it can operate and has to be executed with root privileges.
all modern operating systems can be loaded into uefi, consider this one of the stages of standardization: let all virtual operating systems be loaded into uefi, if possible.@Marciboy, just curious but what's the reason do you need gen2?
Huge thanks. It helped me out as I've just hit some improvement at a cloud provider where only UEFI boot became possible since I've installed a CHR there the last time. Even better, I've installed CHR 7.14.3 using the script and the console works just fine.Bellow is a script to correct this issues.
Wow, very cool!CHR is intended for deployment as a virtual machine - where you need a virtualized router you are familiar with rather than a bare Linux for production, or where you need to simulate some complicated setups, or where you just need a Mikrotik router running on a public IP for some training, which was my particular reason to deploy two CHRs today.
The virtualization host may be your Proxmox or another virtualization platform runninng on your old PC at home or on a bare metal in a data center, but you may also install CHR as a virtual server at some cloud provider, where you share the hardware with other customers. In all these cases, the virtualization system emulates also the boot environment; some of them allow both "legacy" BIOS mode and UEFI mode, some only one of them.
As of 7.15.3, the raw image of the CHR you can download from Mikrotik pages is not compatible with the UEFI mode as-is, so the clever script above is required to convert it to a compatible format before deploying it.
Indeed. Mikrotik recommends exactly this approach (a virtualization platform and a CHR on it even if the CHR would be the only VM running there) over the "x86" product that runs on bare metal but may be a bit behind with the network card drivers etc.Do I understand correclty that I can take a regular x86 PC, put a few NICs in it and run a virtualized instance of ROS making the entire box a router (or firewall)?
So it not really the "hybrid" MBR/GPT disk partitioning that's the issue here... the bigger issue is the disk formatting — basically ext2 file system is not readable by some EUFI BIOSes. See https://uefi.org/specs/UEFI/2.10/13_Pro ... tem-formatAlso partition that has efi files on it is formatted as ext2 so it is not in line with UEFI standard which require that EFI files are stored on FAT/16/32 partition.
(
echo 2 # use GPT
echo t # change partition code
echo 1 # select first partition
echo 8300 # change code to Linux filesystem 8300
echo r # Recovery/transformation
echo h # Hybrid MBR
echo 1 2 # partitions added to the hybrid MBR
echo n # Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N)
echo # Enter an MBR hex code (default 83)
echo y # Set the bootable flag? (Y/N)
echo # Enter an MBR hex code (default 83)
echo n # Set the bootable flag? (Y/N)
echo n # Unused partition space(s) found. Use one to protect more partitions? (Y/N)
echo w # write changes to disk
echo y # confirm
) | gdisk /dev/nbd0
vs.7.14.3 (good)
Command (? for help): v
No problems found. 0 free sectors (0 bytes) available in 0
segments, the largest of which is 0 (0 bytes) in size.
Command (? for help): i
Partition number (1-2): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 7009F6C9-F6E7-884F-B847-90C15779364A
First sector: 34 (at 17.0 KiB)
Last sector: 65569 (at 32.0 MiB)
Partition size: 65536 sectors (32.0 MiB)
Attribute flags: 0000000000000004
Partition name: 'RouterOS Boot'
Command (? for help): i
Partition number (1-2): 2
Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
Partition unique GUID: 3E1AF678-B766-9E4E-BF6D-A84F74F7DB80
First sector: 65570 (at 32.0 MiB)
Last sector: 258047 (at 126.0 MiB)
Partition size: 192478 sectors (94.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'RouterOS'
P.P.S.: As a curiosity only, the 7.14.3 image has a disk signature (which should mean that it has been mounted/accessed on a Windows system) and "botched" CHS values in the two partitions in the MBR.7.15.3 (bad)
Command (? for help): v
Problem: partitions 2 and 1 overlap:
Partition 2: 65570 to 258048
Partition 1: 34 to 65570
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Identified 2 problems!
Command (? for help): i
Partition number (1-2): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 530D7DB7-E875-CC44-9ABD-7F5CAEC90E75
First sector: 34 (at 17.0 KiB)
Last sector: 65570 (at 32.0 MiB)
Partition size: 65537 sectors (32.0 MiB)
Attribute flags: 0000000000000004
Partition name: 'RouterOS Boot'
Command (? for help): i
Partition number (1-2): 2
Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
Partition unique GUID: 37D0E30B-6AA9-EF4E-A67A-4770FC37A330
First sector: 65570 (at 32.0 MiB)
Last sector: 258048 (at 126.0 MiB)
Partition size: 192479 sectors (94.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'RouterOS'
It depends on the local meaning of the symbolic address "there"Is there a free environment where the image bootability can be tested?
If you have the time/will to test (before the images), the actual gdisk script on a Linux machine, it's fine, no need to exchange large files.I can offer testing the images on both Proxmox and Hyper-V and, once that proves successful, even in the paid environment, but I suspect the logistics might be a bit complicated.
(
echo 2 # use GPT
echo x # extra functionality
echo e # relocate backup data structures to the end of the disk
echo r # Recovery/transformation
echo f # load MBR and build fresh GPT from it
echo y # Warning! This will destroy the currently defined partitions! Proceed? (Y/N):
echo x # extra functionality
echo a # set attributes
echo 1 # Partition number (1-2):
echo 2 # Toggle which attribute field (0-63, 64 or <Enter> to exit):
echo # Toggle which attribute field (0-63, 64 or <Enter> to exit):
echo m # return to main menu
echo t # change partition code
echo 1 # select first partition
echo EF00 # Hex code or GUID (L to show codes, Enter = EF00):
echo c # change a partition's name
echo 1 # Partition number (1-2):
echo RouterOS Boot # Enter name:
echo c # change a partition's name
echo 2 # Partition number (1-2):
echo RouterOS # Enter name:
echo w # write changes to disk
echo y # confirm
) | gdisk /dev/nbd0
I have no idea. As I said, at least for Apple Virtualization EFI, 7.15.3 works with @krisnos's script.@Ammo
What Is strange from your report is that - in theory - the original script should not work at all on the 7.15.3 as gdisk should refuse to write the modifications due to the errors.
2024-09-22 17:02:30 (12.5 MB/s) - ‘/tmp/chr-7.16rc4.img.zip’ saved [40320254/40320254]
mkfs.fat 4.2 (2021-01-31)
GPT fdisk (gdisk) version 1.0.8
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present
Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: Using GPT and creating fresh protective MBR.
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Command (? for help):
Expert command (? for help): Relocating backup data structures to the end of the disk
Expert command (? for help):
Recovery/transformation command (? for help): Warning! This will destroy the currently defined partitions! Proceed? (Y/N):
Recovery/transformation command (? for help):
Expert command (? for help): Partition number (1-2): Known attributes are:
0: system partition
1: hide from EFI
2: legacy BIOS bootable
60: read-only
62: hidden
63: do not automount
Attribute value is 0000000000000000. Set fields are:
No fields set
Toggle which attribute field (0-63, 64 or <Enter> to exit): Have enabled the 'legacy BIOS bootable' attribute.
Attribute value is 0000000000000004. Set fields are:
2 (legacy BIOS bootable)
Toggle which attribute field (0-63, 64 or <Enter> to exit):
Expert command (? for help):
Command (? for help): Partition number (1-2): Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'EFI system partition'
Command (? for help): Partition number (1-2): Enter name:
Command (? for help): Partition number (1-2): Enter name:
Command (? for help):
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): OK; writing new GUID partition table (GPT) to /dev/nbd0.
The operation has completed successfully.
/dev/nbd0 disconnected
created file chr.qcow2, now back to raw but uncompressed...
created file chr.vmdk too
created file ZIP with raw files (for debuging)
adding: diskfiles/ (stored 0%)
adding: diskfiles/part1/ (stored 0%)
adding: diskfiles/part2/ (stored 0%)
adding: diskfiles/part2/boot/ (stored 0%)
adding: diskfiles/part2/dev/ (stored 0%)
adding: diskfiles/part2/dev/bootpart/
zip warning: file and directory with the same name: diskfiles/part2/dev/bootpart/
adding: diskfiles/part2/dev/bootdev/
zip warning: file and directory with the same name: diskfiles/part2/dev/bootdev/
adding: diskfiles/part2/rw/ (stored 0%)
adding: diskfiles/part2/rw/autorun.scr (stored 0%)
adding: diskfiles/part2/rw/REBOOT (stored 0%)
adding: diskfiles/part2/UPGRADED (stored 0%)
adding: diskfiles/part2/nova/ (stored 0%)
adding: diskfiles/part2/nova/etc/ (stored 0%)
adding: diskfiles/part2/nova/etc/serial (stored 0%)
adding: diskfiles/part2/SHOW_LICENSE (stored 0%)
adding: diskfiles/part2/bin/ (stored 0%)
adding: diskfiles/part2/bin/bash (deflated 61%)
adding: diskfiles/part2/bin/milo (deflated 42%)
adding: diskfiles/part2/var/ (stored 0%)
adding: diskfiles/part2/var/pdb/ (stored 0%)
adding: diskfiles/part2/var/pdb/system/ (stored 0%)
adding: diskfiles/part2/var/pdb/system/image (deflated 1%)
adding: diskfiles/part2/lost+found/ (stored 0%)
zip warning: Not all files were readable
files/entries read: 21 (17M bytes) skipped: 2 (0 bytes)
*** created chr-7.16rc4.uefi-fat for RAW and VMDK
mkfs.fat 4.2 (2021-01-31)
GPT fdisk (gdisk) version 1.0.8
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present
Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: Using GPT and creating fresh protective MBR.
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Command (? for help):
Expert command (? for help): Relocating backup data structures to the end of the disk
Expert command (? for help):
Recovery/transformation command (? for help): Warning! This will destroy the currently defined partitions! Proceed? (Y/N):
Recovery/transformation command (? for help):
Expert command (? for help): Partition number (1-2): Known attributes are:
0: system partition
1: hide from EFI
2: legacy BIOS bootable
60: read-only
62: hidden
63: do not automount
Attribute value is 0000000000000000. Set fields are:
No fields set
Toggle which attribute field (0-63, 64 or <Enter> to exit): Have enabled the 'legacy BIOS bootable' attribute.
Attribute value is 0000000000000004. Set fields are:
2 (legacy BIOS bootable)
Toggle which attribute field (0-63, 64 or <Enter> to exit):
Expert command (? for help):
Command (? for help): Partition number (1-2): Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'EFI system partition'
Command (? for help): Partition number (1-2): Enter name:
Command (? for help): Partition number (1-2): Enter name:
Command (? for help):
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): OK; writing new GUID partition table (GPT) to /dev/nbd0.
The operation has completed successfully.
/dev/nbd0 disconnected
created file chr.qcow2, now back to raw but uncompressed...
created file chr.vmdk too
created file ZIP with raw files (for debuging)
adding: diskfiles/ (stored 0%)
adding: diskfiles/part1/ (stored 0%)
adding: diskfiles/part2/ (stored 0%)
adding: diskfiles/part2/boot/ (stored 0%)
adding: diskfiles/part2/dev/ (stored 0%)
adding: diskfiles/part2/dev/bootpart/
zip warning: file and directory with the same name: diskfiles/part2/dev/bootpart/
adding: diskfiles/part2/dev/bootdev/
zip warning: file and directory with the same name: diskfiles/part2/dev/bootdev/
adding: diskfiles/part2/rw/ (stored 0%)
adding: diskfiles/part2/rw/autorun.scr (stored 0%)
adding: diskfiles/part2/rw/REBOOT (stored 0%)
adding: diskfiles/part2/UPGRADED (stored 0%)
adding: diskfiles/part2/nova/ (stored 0%)
adding: diskfiles/part2/nova/etc/ (stored 0%)
adding: diskfiles/part2/nova/etc/serial (stored 0%)
adding: diskfiles/part2/SHOW_LICENSE (stored 0%)
adding: diskfiles/part2/bin/ (stored 0%)
adding: diskfiles/part2/bin/bash (deflated 61%)
adding: diskfiles/part2/bin/milo (deflated 42%)
adding: diskfiles/part2/var/ (stored 0%)
adding: diskfiles/part2/var/pdb/ (stored 0%)
adding: diskfiles/part2/var/pdb/system/ (stored 0%)
adding: diskfiles/part2/var/pdb/system/image (deflated 1%)
adding: diskfiles/part2/lost+found/ (stored 0%)
zip warning: Not all files were readable
files/entries read: 21 (17M bytes) skipped: 2 (0 bytes)
*** created chr-7.15.3.uefi-fat for RAW and VMDK
Well, you know, it works in UTM+Apple, but got errors with gdisk during build. I re-ran the build just now, and got what's below for @kriszos's script:The errors should prevent gdisk from writing the changes, thus the image before and after running the original gdisk script should remain unchanged.
The full build script which includes the qemu-img etc commands is here:2024-09-23 00:37:54 (7.98 MB/s) - ‘/tmp/chr-7.15.3.img.zip’ saved [40110443/40110443]
mkfs.fat 4.2 (2021-01-31)
GPT fdisk (gdisk) version 1.0.8
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present
Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: Using GPT and creating fresh protective MBR.
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Command (? for help): Partition number (1-2): Current type is EF00 (EFI system partition)
Hex code or GUID (L to show codes, Enter = EF00): Changed type of partition to 'Linux filesystem'
Command (? for help):
Recovery/transformation command (? for help):
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N):
Creating entry for GPT partition #1 (MBR partition #1)
Enter an MBR hex code (default 83): Set the bootable flag? (Y/N):
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default 83): Set the bootable flag? (Y/N):
Aborting write operation!
Unused partition space(s) found. Use one to protect more partitions? (Y/N):
Recovery/transformation command (? for help):
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Problem: partitions 2 and 1 overlap:
Partition 2: 65570 to 258048
Partition 1: 34 to 65570
Aborting write of new partition table.
Recovery/transformation command (? for help): b use backup GPT header (rebuilding main)
c load backup partition table from disk (rebuilding main)
d use main GPT header (rebuilding backup)
e load main partition table from disk (rebuilding backup)
f load MBR and build fresh GPT from it
g convert GPT into MBR and exit
h make hybrid MBR
i show detailed information on a partition
l load partition data from a backup file
m return to main menu
o print protective MBR data
p print the partition table
q quit without saving changes
t transform BSD disklabel partition
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu
Recovery/transformation command (? for help): /dev/nbd0 disconnected
created file chr.qcow2, now back to raw but uncompressed...
created file chr.vmdk too
created file ZIP with raw files (for debuging)
adding: diskfiles/ (stored 0%)
adding: diskfiles/part1/ (stored 0%)
adding: diskfiles/part1/map (deflated 47%)
adding: diskfiles/part1/EFI/ (stored 0%)
adding: diskfiles/part1/EFI/BOOT/ (stored 0%)
adding: diskfiles/part1/EFI/BOOT/BOOTX64.EFI (deflated 4%)
adding: diskfiles/part1/lost+found/ (stored 0%)
adding: diskfiles/part2/ (stored 0%)
adding: diskfiles/part2/boot/ (stored 0%)
adding: diskfiles/part2/dev/ (stored 0%)
adding: diskfiles/part2/dev/bootpart/
zip warning: file and directory with the same name: diskfiles/part2/dev/bootpart/
adding: diskfiles/part2/dev/bootdev/
zip warning: file and directory with the same name: diskfiles/part2/dev/bootdev/
adding: diskfiles/part2/rw/ (stored 0%)
adding: diskfiles/part2/rw/autorun.scr (stored 0%)
adding: diskfiles/part2/rw/REBOOT (stored 0%)
adding: diskfiles/part2/UPGRADED (stored 0%)
adding: diskfiles/part2/nova/ (stored 0%)
adding: diskfiles/part2/nova/etc/ (stored 0%)
adding: diskfiles/part2/nova/etc/serial (stored 0%)
adding: diskfiles/part2/SHOW_LICENSE (stored 0%)
adding: diskfiles/part2/bin/ (stored 0%)
adding: diskfiles/part2/bin/bash (deflated 61%)
adding: diskfiles/part2/bin/milo (deflated 42%)
adding: diskfiles/part2/var/ (stored 0%)
adding: diskfiles/part2/var/pdb/ (stored 0%)
adding: diskfiles/part2/var/pdb/system/ (stored 0%)
adding: diskfiles/part2/var/pdb/system/image (deflated 1%)
adding: diskfiles/part2/lost+found/ (stored 0%)
zip warning: Not all files were readable
files/entries read: 26 (21M bytes) skipped: 2 (0 bytes)
*** created chr-7.15.3.uefi-fat for RAW and VMDK
mkfs.fat 4.2 (2021-01-31)
GPT fdisk (gdisk) version 1.0.9
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present
Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: Using GPT and creating fresh protective MBR.
Command (? for help):
Expert command (? for help): Relocating backup data structures to the end of the disk
Expert command (? for help):
Recovery/transformation command (? for help): Warning! This will destroy the currently defined partitions! Proceed? (Y/N):
Recovery/transformation command (? for help):
Expert command (? for help): Partition number (1-2): Known attributes are:
0: system partition
1: hide from EFI
2: legacy BIOS bootable
60: read-only
62: hidden
63: do not automount
Attribute value is 0000000000000000. Set fields are:
No fields set
Toggle which attribute field (0-63, 64 or <Enter> to exit): Have enabled the 'legacy BIOS bootable' attribute.
Attribute value is 0000000000000004. Set fields are:
2 (legacy BIOS bootable)
Toggle which attribute field (0-63, 64 or <Enter> to exit):
Expert command (? for help):
Command (? for help): Partition number (1-2): Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'EFI system partition'
Command (? for help): Partition number (1-2): Enter name:
Command (? for help): Partition number (1-2): Enter name:
Command (? for help):
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): OK; writing new GUID partition table (GPT) to /dev/nbd0.
The operation has completed successfully.
/dev/nbd0 disconnected
script finished, created file chr-uefi.img
mkfs.fat 4.2 (2021-01-31)
GPT fdisk (gdisk) version 1.0.9
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present
Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: Using GPT and creating fresh protective MBR.
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Command (? for help):
Expert command (? for help): Relocating backup data structures to the end of the disk
Expert command (? for help):
Recovery/transformation command (? for help): Warning! This will destroy the currently defined partitions! Proceed? (Y/N):
Recovery/transformation command (? for help):
Expert command (? for help): Partition number (1-2): Known attributes are:
0: system partition
1: hide from EFI
2: legacy BIOS bootable
60: read-only
62: hidden
63: do not automount
Attribute value is 0000000000000000. Set fields are:
No fields set
Toggle which attribute field (0-63, 64 or <Enter> to exit): Have enabled the 'legacy BIOS bootable' attribute.
Attribute value is 0000000000000004. Set fields are:
2 (legacy BIOS bootable)
Toggle which attribute field (0-63, 64 or <Enter> to exit):
Expert command (? for help):
Command (? for help): Partition number (1-2): Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'EFI system partition'
Command (? for help): Partition number (1-2): Enter name:
Command (? for help): Partition number (1-2): Enter name:
Command (? for help):
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): OK; writing new GUID partition table (GPT) to /dev/nbd0.
The operation has completed successfully.
/dev/nbd0 disconnected
script finished, created file chr-uefi.img
That is not "an error", it is a "critical error", as it means that the original @kriszos's script doesn't actually do anything (at least on the "wrong" 7.15.3).Problem: partitions 2 and 1 overlap:
Partition 2: 65570 to 258048
Partition 1: 34 to 65570
Aborting write of new partition table.
....
Recovery/transformation command (? for help):
/dev/nbd0 disconnected
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N):
Creating entry for GPT partition #1 (MBR partition #1)
Enter an MBR hex code (default 83): Set the bootable flag? (Y/N):
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default 83): Set the bootable flag? (Y/N):
Aborting write operation!
Unused partition space(s) found. Use one to protect more partitions? (Y/N):
Try removing completely the gdisk script from the overall script and try running it on 7.15.3.Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): OK; writing new GUID partition table (GPT) to /dev/nbd0.
The operation has completed successfully.
/dev/nbd0 disconnected
Hmm. If the image works, I never check the build logs... But, yeah, gdisk isn't doing anything from the logs. So I just REMOVED the ANY `gdisk` operation from my script, and the built image still works with UTM+Apple (requiring EFI) - both 7.15.3 and 7.16rc4. And confirmed a Mikrotik-download IMG file does NOT work for same versions on UTM+Apple. So something get changed in my script, even without gdisk.... But I cannot speak to if "Gen2" or other hypervisors do need some different partitioning since I didn't test it.EDIT: Confirmed, the first few sectors (the relevant ones, MBR, Efi Part and the two entries in EFI partition tables) are identical between the original chr-7.15.3.img image and the modified raw one chr-7.15.3.uefi-fat.raw, so the original gdisk script does nothing to it.
We have been barking up the wrong tree.
ROSVER=7.16rc4
wget --no-check-certificate https://download.mikrotik.com/routeros/$ROSVER/chr-$ROSVER.img.zip -O /tmp/chr-$ROSVER.img.zip
unzip -p /tmp/chr-$ROSVER.img.zip > /tmp/chr-$ROSVER.img
rm -rf chr-$ROSVER.qcow2
qemu-img convert -f raw -O qcow2 /tmp/chr-$ROSVER.img chr-$ROSVER.qcow2
rm -rf /tmp/chr-$ROSVER.im*
modprobe nbd
qemu-nbd -c /dev/nbd0 chr-$ROSVER.qcow2
rm -rf /tmp/tmp*
mkdir /tmp/tmpmount/
mkdir diskfiles
mkdir /tmp/tmpefipart/
mount /dev/nbd0p1 /tmp/tmpmount/
rsync -a /tmp/tmpmount/ /tmp/tmpefipart/
mkdir diskfiles/part1
rsync -a /tmp/tmpmount/ ./diskfiles/part1/
umount /dev/nbd0p1
mkfs -t fat /dev/nbd0p1
mount /dev/nbd0p1 /tmp/tmpmount/
rsync -a /tmp/tmpefipart/ /tmp/tmpmount/
umount /dev/nbd0p1
mount /dev/nbd0p2 /tmp/tmpmount/
mkdir diskfiles/part2
rsync -a /tmp/tmpmount/ ./diskfiles/part2/
umount /dev/nbd0p2
rm -rf /tmp/tmp*
# ALL GDISK MODS DISABLE
# @kriszos approach
# (
# echo 2 # use GPT
# ...
# echo y # confirm
# ) | gdisk /dev/nbd0
# @jaclaz
# (
# echo 2 # use GPT
# ...
# echo y # confirm
# ) | gdisk /dev/nbd0
qemu-nbd -d /dev/nbd0
echo "created file chr.qcow2, now back to raw but uncompressed..."
qemu-img convert -f qcow2 -O raw chr-$ROSVER.qcow2 chr-$ROSVER.uefi-fat.raw
Just to be sure, did you actually mean that the last sector of one partition overlaps with the first sector of the following one, as in "the first one is one sector larger than it should be" or "the second one is positioned one sector earlier than it should be"?Thinking about it, it is entirely possible as the overlap is only on the last sector of the two partitions
Do I get it right that you assume that the UEFI boot does not care about even the presence, let alone the actual contents, of the backup table if the basic one is available & readable?the booting process has no reason to access them, not even to read them, and the fact that there is no protective partition in the MBR is likely irrelevant if the UEFI accesses first the GPT partition table.
GPT fdisk (gdisk) version 1.0.9
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present
Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: 2
Using GPT and creating fresh protective MBR.
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Command (? for help): ?
b back up GPT data to a file
c change a partition's name
d delete a partition
i show detailed information on a partition
l list known partition types
n add a new partition
o create a new empty GUID partition table (GPT)
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s sort partitions
t change a partition's type code
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu
Command (? for help): i
Partition number (1-2): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI system partition)
Partition unique GUID: 530D7DB7-E875-CC44-9ABD-7F5CAEC90E75
First sector: 34 (at 17.0 KiB)
Last sector: 65570 (at 32.0 MiB)
Partition size: 65537 sectors (32.0 MiB)
Attribute flags: 0000000000000004
Partition name: 'RouterOS Boot'
Command (? for help): d
Partition number (1-2): 1
Command (? for help): n
Partition number (1-128, default 1):
First sector (34-65569, default = 34) or {+-}size{KMGTP}:
Last sector (34-65569, default = 65569) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'
Command (? for help): c
Partition number (1-2): 1
Enter name: RouterOS Boot
Command (? for help): i
Partition number (1-2): 2
Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
Partition unique GUID: 37D0E30B-6AA9-EF4E-A67A-4770FC37A330
First sector: 65570 (at 32.0 MiB)
Last sector: 258048 (at 126.0 MiB)
Partition size: 192479 sectors (94.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'RouterOS'
Command (? for help): d
Partition number (1-2): 2
Command (? for help): n
Partition number (2-128, default 2):
First sector (65570-258047, default = 65570) or {+-}size{KMGTP}:
Last sector (65570-258047, default = 258047) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'
Command (? for help): p
Disk /dev/nbd0: 262144 sectors, 128.0 MiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 3C834E61-1789-A742-80F6-7799E266B0E8
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 258047
Partitions will be aligned on 2-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 34 65569 32.0 MiB 8300 RouterOS Boot
2 65570 258047 94.0 MiB 8300 Linux filesystem
Command (? for help): c
Partition number (1-2): 2
Enter name: RouterOS
Command (? for help): p
Disk /dev/nbd0: 262144 sectors, 128.0 MiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 3C834E61-1789-A742-80F6-7799E266B0E8
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 258047
Partitions will be aligned on 2-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 34 65569 32.0 MiB 8300 RouterOS Boot
2 65570 258047 94.0 MiB 8300 RouterOS
Command (? for help): r
Recovery/transformation command (? for help): h
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 1 2
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): n
Creating entry for GPT partition #1 (MBR partition #1)
Enter an MBR hex code (default 83):
Set the bootable flag? (Y/N): y
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default 83):
Set the bootable flag? (Y/N): n
Unused partition space(s) found. Use one to protect more partitions? (Y/N): y
Note: Default is 0xEE, but this may confuse Mac OS X.
Enter an MBR hex code (default EE):
Recovery/transformation command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/nbd0.
Caution: More than one 0xEE MBR partition found. This can cause problems
in some OSes.
The operation has completed successfully.
/dev/nbd0 disconnected
But Mikrotik's native images should work in that case. It's just a few EFI BIOS (i.e. HyperV "Gen2", Apple's Virtualization Framework) where there is not an option to use legacy BIOS. Would it be "better" to always use EFI if available...my guess is yes since it's just a more direct path to starting the Linux kernel.About BIOS booting, it cannot really work,
its partition table is some kind of Frankenstein between GPT and MBR.
# Disk DescriptorFile
version=1
createType=
RW 262144 FLAT "chr-7.15.3.uefi-fat.raw" 0
ddb.uuid.image="46AB3892-1E5E-6FDF-64DA-2C2F6B3017B1"
(
echo 2 # use GPT
echo x # extra functionality
echo e # relocate backup data structures to the end of the disk
echo r # Recovery/transformation
echo f # load MBR and build fresh GPT from it
echo y # Warning! This will destroy the currently defined partitions! Proceed? (Y/N):
echo x # extra functionality
echo a # set attributes
echo 1 # Partition number (1-2):
echo 2 # Toggle which attribute field (0-63, 64 or <Enter> to exit):
echo # Toggle which attribute field (0-63, 64 or <Enter> to exit):
echo m # return to main menu
echo t # change partition code
echo 1 # select first partition
echo EF00 # Hex code or GUID (L to show codes, Enter = EF00):
echo c # change a partition's name
echo 1 # Partition number (1-2):
echo RouterOS Boot # Enter name:
echo c # change a partition's name
echo 2 # Partition number (1-2):
echo RouterOS # Enter name:
echo x # extra functionality
echo r # Recovery/transformation
echo h # Hybrid MBR
echo 1 2 # partitions added to the hybrid MBR
echo n # Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N)
echo 83 # Enter an MBR hex code (default 83)
echo y # Set the bootable flag? (Y/N)
echo 83 # Enter an MBR hex code (default 83)
echo n # Set the bootable flag? (Y/N)
echo n # Unused partition space(s) found. Use one to protect more partitions? (Y/N)
echo w # write changes to disk
echo y # confirm
) | gdisk /dev/nbd0
I quickly re-factored my CHR builder. So there are now 7.16 images, using the three approaches: @jaclaz's latest (chr-7.15.3.uefi-fat-jaclaz.raw), @kriszos's original (chr-7.15.3.uefi-fat-kriszos.raw), and "no gdisk" (chr-7.15.3.uefi-fat-no-gdisk.raw), see:Sorry, double post.
Sorry, it was neither soon nor 100% success.as soon as Sindy will be able to (hopefully) report success in the environment(s) he uses, the matter should be pseudo-solved.
And here is the @jaclaz script running:GPT fdisk (gdisk) version 1.0.8
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present
Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: Using GPT and creating fresh protective MBR.
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Command (? for help): Partition number (1-2): Current type is EF00 (EFI system partition)
Hex code or GUID (L to show codes, Enter = EF00): Changed type of partition to 'Linux filesystem'
Command (? for help):
Recovery/transformation command (? for help):
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N):
Creating entry for GPT partition #1 (MBR partition #1)
Enter an MBR hex code (default 83): Set the bootable flag? (Y/N):
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default 83): Set the bootable flag? (Y/N):
Unused partition space(s) found. Use one to protect more partitions? (Y/N):
Aborting write operation!
Recovery/transformation command (? for help):
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Problem: partitions 2 and 1 overlap:
Partition 2: 65570 to 258048
Partition 1: 34 to 65570
Aborting write of new partition table.
Recovery/transformation command (? for help): b use backup GPT header (rebuilding main)
c load backup partition table from disk (rebuilding main)
d use main GPT header (rebuilding backup)
e load main partition table from disk (rebuilding backup)
f load MBR and build fresh GPT from it
g convert GPT into MBR and exit
h make hybrid MBR
i show detailed information on a partition
l load partition data from a backup file
m return to main menu
o print protective MBR data
p print the partition table
q quit without saving changes
t transform BSD disklabel partition
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu
Recovery/transformation command (? for help): /dev/nbd0 disconnected
2024-09-27 17:20:22 URL:https://download.mikrotik.com/routeros/ ... a2.img.zip [41086700/41086700] -> "/tmp/chr-7.17beta2.img.zip" [1]
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 63.9M 1 loop /snap/core20/2318
loop1 7:1 0 87M 1 loop /snap/lxd/29351
loop2 7:2 0 38.8M 1 loop /snap/snapd/21759
sda 8:0 0 75G 0 disk
└─sda1 8:1 0 75G 0 part /mnt
sdb 8:16 0 75G 0 disk
├─sdb1 8:17 0 74.9G 0 part /
├─sdb14 8:30 0 4M 0 part
└─sdb15 8:31 0 106M 0 part /boot/efi
nbd0 43:0 0 128M 0 disk
├─nbd0p1 43:1 0 32M 0 part
└─nbd0p2 43:2 0 94M 0 part
nbd1 43:32 0 0B 0 disk
nbd2 43:64 0 0B 0 disk
nbd3 43:96 0 0B 0 disk
nbd4 43:128 0 0B 0 disk
nbd5 43:160 0 0B 0 disk
nbd6 43:192 0 0B 0 disk
nbd7 43:224 0 0B 0 disk
nbd8 43:256 0 0B 0 disk
nbd9 43:288 0 0B 0 disk
nbd10 43:320 0 0B 0 disk
nbd11 43:352 0 0B 0 disk
nbd12 43:384 0 0B 0 disk
nbd13 43:416 0 0B 0 disk
nbd14 43:448 0 0B 0 disk
nbd15 43:480 0 0B 0 disk
mkfs.fat 4.2 (2021-01-31)
GPT fdisk (gdisk) version 1.0.8
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present
Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: Using GPT and creating fresh protective MBR.
Warning! Secondary partition table overlaps the last partition by
1 blocks!
Try reducing the partition table size by 4 entries.
(Use the 's' item on the experts' menu.)
Command (? for help):
Expert command (? for help): Relocating backup data structures to the end of the disk
Expert command (? for help):
Recovery/transformation command (? for help): Warning! This will destroy the currently defined partitions! Proceed? (Y/N):
Recovery/transformation command (? for help):
Expert command (? for help): Partition number (1-2): Known attributes are:
0: system partition
1: hide from EFI
2: legacy BIOS bootable
60: read-only
62: hidden
63: do not automount
Attribute value is 0000000000000000. Set fields are:
No fields set
Toggle which attribute field (0-63, 64 or <Enter> to exit): Have enabled the 'legacy BIOS bootable' attribute.
Attribute value is 0000000000000004. Set fields are:
2 (legacy BIOS bootable)
Toggle which attribute field (0-63, 64 or <Enter> to exit):
Expert command (? for help):
Command (? for help): Partition number (1-2): Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'EFI system partition'
Command (? for help): Partition number (1-2): Enter name:
Command (? for help): Partition number (1-2): Enter name:
Command (? for help):
Expert command (? for help):
Recovery/transformation command (? for help):
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N):
Creating entry for GPT partition #1 (MBR partition #1)
Enter an MBR hex code (default EF): Set the bootable flag? (Y/N):
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default 83): Set the bootable flag? (Y/N):
Unused partition space(s) found. Use one to protect more partitions? (Y/N):
Recovery/transformation command (? for help):
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): OK; writing new GUID partition table (GPT) to /dev/nbd0.
The operation has completed successfully.
If it's easy, can you try @jaclaz's version at Vultr.., as the gdisk mods did get applied in this one for 7.17beta2: https://github.com/tikoci/fat-chr/relea ... jaclaz.rawSorry, it was neither soon nor 100% success.as soon as Sindy will be able to (hopefully) report success in the environment(s) he uses, the matter should be pseudo-solved.
Both the pre-cooked images from @Amm0 I've tried, i.e. chr-7.16.uefi-fat.raw and chr-7.16.uefi-fat-kriszos.raw, [...] neither of the two images worked at the cloud provider (Vultr) where the 7.14.3 image mangled using the script by @kriszos from post #2 did work fine.
And I rebuilt the 7.15.3 and 7.16 images to use/default to the @jaclaz variant on GitHub:@jaclaz, you're the boss - 7.17.beta2 mangled using your gdisk magic made Vultr happy.
Tested on mac with arm64 or x86_64 arch?Test them both using Apple Virtualization (in UTM and Swift Playground), so they generally work.
Since I'm running the CHR superstore, I built an ARM64 image with the FAT modification for 7.17beta2:Tested on mac with arm64 or x86_64 arch?Test them both using Apple Virtualization (in UTM and Swift Playground), so they generally work.
Remove the display – that does not work in UTM+Apple. It's serial only on X86, so imagine it's the same on ARM64. I think Apple uses some virtio-*-gpu things, but RouterOS does not have right driver/support for Display.No luck, same issue as with my modifications on image.
com.apple.Virtualization.VirtualMachine stuck on 400% cpu, it seems loop, no output on serial console or display.
Tried without display (using like that on Intel mac), added additionally display just to see if anything will appear.Remove the display – that does not work in UTM+Apple. It's serial only on X86, so imagine it's the same on ARM64. I think Apple uses some virtio-*-gpu things, but RouterOS does not have right driver/support for Display.
Thx, seen that, but not interested using QEMU. Since I have it running on Intel mac, on arm mac was just POC tryout.Also @Kartone in my Apple+UTM thread, had more tips if you want to QEMU with "stock image":
viewtopic.php?t=204805&hilit=UTM&sid=28 ... 0#p1079177
Yeah same boat, I have 2019 MacBook Pro with Intel i9. Since I do deal with [Intel] VMs enough, I didn't want to mess with Rosetta .Since I have it running on Intel mac, on arm mac was just POC tryout.
Well we tried. There not a lot options to tweak, and I'd image the issue with AppleVM + CHR + ARM64 isn't partitioning. Thanks!Tried also with NVMe interface, I'm running also Debian arm64 with Apple Virtualization and it requires NVMe to avoid FS corruption, unfortunately for ROS boot same result.
Good.@jaclaz, you're the boss - 7.17.beta2 mangled using your gdisk magic made Vultr happy.
Sure, I know, it is more like, you know@jaclaz, I wouldn't get too crazy.
The IPXE could be another royal PITA, I am now a bit rusty about BIOS/UEFI and filesystems, but at least in my days I was familiar enough with that kind of stuff, PXE/IPXE I only touched a few times, and never really studied it in detail.The way I see it, if you're gonna build a time machine into a car, why not do it with some *style?*
Yeah that was my point to @jaclaz – Mikrotik should fix the UEFI & they'd know WAY more since nothing is exactly "standard linux" in these images (e.g. I presume their milo is some custom lilo, etc. etc.).Somehow, I would expect gentlemen in Riga to provide either "BIOS CHR" and "UEFI CHR" images or a "universal CHR" image off the shelf rather than offloading that task to volunteers. [...]
I hadn't looked at the Vultr instructions in Mikrotik's help until this thread, that's a travesty. The Vultr looks pretty reasonable offering and relative cheap. For $5/month and $50/once for CHR, it looks like you can get a public IP for tunnel/VPN/etc. It's like they don't want to sell more CHR licenses... if you could bring up a CHR in a couple steps, folks might actually get to point where they can license it .it is in fact bad enough that one has to use the recovery Linux "CD" (.iso) to install a CHR image since no CHR .iso is available
So to summarize, is this worth a support ticket?
And after the recent discussion here & noticing there ~10K on esoteric topic like UEFI... I even added link this thread last week — to highlight it wasn't just me & 10K views on the topic of "UEFI", but I got this back:Thank you for the suggestion, we will consider it.
So if you want to "vote" for doing something, apparently either post you need it, or file a ticket. (Now on the metrics... mDNS took 100K forum post views for something to come out .And there are only 9 users who are posting in this thread... As I said previously we will consider if there will be user demand.
Two images for download: chr-bios.raw and chr-uefi.raw (*with UEFI actually tested and partitioned according to specs, which ext2 is not) would go a long way. The universal image is how we got here... but IDK maybe it's fixable.I would expect gentlemen in Riga to provide either "BIOS CHR" and "UEFI CHR" images or a "universal CHR" image off the shelf rather than offloading that task to volunteers. [...] so a UEFI boot in a hosting is not a niche case any more.
I can offer a self-service solution to building them....NOT a fully tested script, only the needed info and the commands I used manually.
Hey! When I was setting up ROS 7.1.3 on Hyper-V Gen2, I found it helpful to use a VHDX file for the installation. Make sure the image you’re using is compatible with UEFI boot since that can cause issues if it’s not. I had some trouble downloading the image smoothly too, so I ended up switching networks and re-downloading, which did the trick. Also, double-check your Hyper-V settings, especially the virtual switch—having that configured right makes a big difference.