Page 1 of 1
how enable container on CHR\x86?
Posted: Fri Sep 02, 2022 11:37 am
by whyborn
hi!
pls tell me how to enable CHR\x86 in system/device-mode/container?
/system/device-mode/updatecontainer=yes asks for a manual poweroff or reset - turn off vps via isp manager there is not working
[admin@CHR] > system/device-mode/print
mode: enterprise
[admin@CHR] > /system/device-mode/update container=yes
update: please activate by turning power off or pressing reset or mode button in 4m33s
-- [Q quit|D dump|C-z pause]
thx
Re: how enable container on CHR\x86?
Posted: Fri Sep 02, 2022 11:48 am
by rextended
You have installed container package, first?
Re: how enable container on CHR\x86?
Posted: Fri Sep 02, 2022 4:26 pm
by whyborn
You have installed container package, first?
yeap
I see container menu, but it gives an error.
[admin@CHR] > /container/add remote-image=pihole/pihole:latest interface=veth1 root-dir=pihole mounts=dnsmasq_pihole,etc_pi
hole envlist=pihole_envs
failure: not allowed by device-mode
[admin@CHR] > system/device-mode/print
mode: enterprise
Re: how enable container on CHR\x86?
Posted: Fri Sep 02, 2022 7:52 pm
by nick209
pls tell me how to enable CHR\x86 in system/device-mode/container?
/system/device-mode/updatecontainer=yes asks for a manual poweroff or reset - turn off vps via isp manager there is not working
+1
I am also unable to change device-mode on my CHR. Turn off or reboot vds over VMmanager is not working for me. Container package is installed.
Re: how enable container on CHR\x86?
Posted: Fri Sep 02, 2022 9:49 pm
by ID
after issue command;
/system/device-mode/update container=yes
do not shutdown or reboot at routeros. power off vm directly.
Re: how enable container on CHR\x86?
Posted: Fri Sep 02, 2022 10:48 pm
by whyborn
m8, Im shutting down my virtual machine in isp manager via "restart" and "stop" buttons
without any effect.
its very strange,
thats why I created this topic here
111.png
anyway thanks for the answer! i hope dev will pay attention to this problem, or they will tell me in detail where im wrong
Re: how enable container on CHR\x86?
Posted: Fri Sep 02, 2022 10:56 pm
by ID
When you do any option, are you see "router was rebooted without proper shutdown" error at first line at log when routeros come back?
Re: how enable container on CHR\x86?
Posted: Fri Sep 02, 2022 10:57 pm
by fragtion
Only thing that worked for me to get it working on AWS, was to launch the cloud vm as an ubuntu/debian VM, then set up the chr with container enabled on another local vm with virtualbox or whatever, ssh the image over to a ramdrive on the ubuntu CHR, and then dd the image and reboot. But beware all of this wipes the license. Oh and I'm sure there's an easier way, but I don't know it
Re: how enable container on CHR\x86?
Posted: Fri Sep 02, 2022 11:27 pm
by whyborn
loss license is catastrophic, thank you, but its not my way
Re: how enable container on CHR\x86?
Posted: Sat Sep 03, 2022 5:31 am
by hegars
I know it probably dosent help your exact problem but I had the exact same issue on Linode.com instances, so I hope this helps someone in the same situation.
The fix was after entering the /system/device-mode/update container=yes then going into the LISH console then issuing a CTL+A then D to exit from the running vm console to the lish submenu, issuing the "destroy" command then finnally the "boot" command.
However you might be able to issue a SysRq B comand, so look that up maybe?
In AWS you'll need to get on the CLI and issue a force stop "aws ec2 stop-instances --force --instance-ids i-xxxxxxxxx". I'll see if I can do it now on my AWS instances and update this post.
Re: how enable container on CHR\x86?
Posted: Sat Sep 03, 2022 6:53 am
by whyborn
When you do any option, are you see "router was rebooted without proper shutdown" error at first line at log when routeros come back?
nope
logs empty
Re: how enable container on CHR\x86?
Posted: Sat Sep 03, 2022 1:19 pm
by ID
You aren't doing anything wrong. Probably when you hit stop or restart isp manager notify routeros and do it graceful reboot/shutdown.
No matter what i did, container permission given only when i force vm to stop like power off and on like hardware. That's why i ask if you see that error/information at first place.
Maybe mikrotik dev's give an exception for CHR instances at later versions since we don't have button and not everybody can hard stop vm because of permissions or incompatibility of software. =/
Anyway if i find easy way to do it, let this thread aware.
Re: how enable container on CHR\x86?
Posted: Sun Sep 04, 2022 11:48 am
by avraamd
Same thing to me when i tried it on VirtualBox, can not update the device-mode.
Re: how enable container on CHR\x86?
Posted: Sun Sep 04, 2022 2:26 pm
by hegars
Same thing to me when i tried it on VirtualBox, can not update the device-mode.
I just tested with latest VirtualBox and it works fine using the "reset" in vitualbox with the CHR 7.5 images
Re: how enable container on CHR\x86?
Posted: Sun Sep 04, 2022 6:45 pm
by avraamd
Correction. After reinstalling VirtualBox worked ok! Thanks
Hello i have the latest Virtualbox, and tried from the VM Menu-->Machine -->Reset.
But the mode did not update to container.
Re: how enable container on CHR\x86?
Posted: Mon Sep 05, 2022 9:47 am
by whyborn
You aren't doing anything wrong. Probably when you hit stop or restart isp manager notify routeros and do it graceful reboot/shutdown.
No matter what i did, container permission given only when i force vm to stop like power off and on like hardware. That's why i ask if you see that error/information at first place.
Maybe mikrotik dev's give an exception for CHR instances at later versions since we don't have button and not everybody can hard stop vm because of permissions or incompatibility of software. =/
Anyway if i find easy way to do it, let this thread aware.
I also thought that from the management console, only a warm restart. I created a ticket with the provider and they answered me in technical support, "stop button in the console executes the virsh shutdown command"
Re: how enable container on CHR\x86? Topic is solved
Posted: Mon Sep 05, 2022 2:45 pm
by hegars
If its virsh then a "virsh destroy" need to be issued. this is the command that initiates an immediate ungraceful shutdown and stops the specified guest virtual machine
https://access.redhat.com/documentation ... rsh-delete
Re: how enable container on CHR\x86?
Posted: Mon Sep 05, 2022 7:54 pm
by whyborn
thnx !
your answer helped
I asked the technical support of my vps provider to do
on the hypervisor to my VM
/system/device-mode/update container=yes
and rearm from console my VM
after hard reset it and everything worked out!
please mark this answer as solved
thank you all for your help and advice
Re: how enable container on CHR\x86?
Posted: Tue Sep 06, 2022 10:15 pm
by nick209
I asked the technical support of my vps provider to do
Unfortunately it doesn't work for my vps provider...
Dear mikrotik developers, please add the ability to change device-mode easier especially for chr
Re: how enable container on CHR\x86?
Posted: Wed Sep 07, 2022 3:34 pm
by hegars
the methods to enable containers are a little harsh but the security implications are pretty wild so you're not going to get very far with support on this one.
Re: how enable container on CHR\x86?
Posted: Sat Sep 10, 2022 10:53 pm
by aleab
i post my experience...
i have a chr on ionos cloud.
i'm able to enable container successful with
/system/device-mode/update container=yes
then on console ionos (i think use vmware)
i shutdown VM ,
when ask me software or hardware i click on hardware shutdown
then start VM
now container is enabled
/system/device-mode/print
mode: enterprise
container: yes
Re: how enable container on CHR\x86?
Posted: Tue Sep 20, 2022 6:11 am
by edv4ld0
On AWS, after install container:
1) Stop EC2 (wait until it's stopped).
2) Using AWS CLI (one after the other):
aws ec2 start-instances --instance-ids i-???
aws ec2 stop-instances --force --instance-ids i-???
* On console in Instance state, it will be showing Stopping.
3) Connect to CHR using your favorite client, to enable the container:
/system/device-mode/update container=yes
The instance will shutdown between 3 and 4 minutes. Wait.
4) Start EC2, the log will appear:
router was rebooted without proper shutdown
* The container will be enabled.
Re: how enable container on CHR\x86?
Posted: Wed Nov 02, 2022 6:08 pm
by vermut
On AWS, after install container:
aws ec2 start-instances --instance-ids i-???
aws ec2 stop-instances --force --instance-ids i-???
I just love the idea. AWS first sends the ACPI shutdown, and in few minutes, if the instance is still up will cold-stop it. And idea presumably is to make the machine "swallow" ACPI command sending that immediately after start.
Unfortunately, I couldn't replicate this on my setup. And I'm doing that just a month later so I doubt AWS changed something.
I was testing on t2.micro. Used the AWS CloudShell to minimize the lag. I also tried to add arbitrary sleeps between start and stop, tried with and without "--force" -- it just shows "Stopping" for 5-10 seconds and stops, without giving me a chance to input anything to terminal.
edv4ld0, could you share more detail how you did that?
Re: how enable container on CHR\x86?
Posted: Sun Nov 13, 2022 12:03 am
by citizen25
I have just spent a few hours trying on a CHR hosted with XCP-ng and I see no way to get this to activate. I can even see if they for chr did this in the licence management and done as a Lic update.
Regardless this needs to be added to winbox or a way for this to be authorized as there is no console for me when off because the system is off and their for is no console.
Re: how enable container on CHR\x86?
Posted: Mon Nov 21, 2022 6:14 pm
by kandar
Hi,
funny I facing same problem on my RB4011iGS+5HacQ2HnD device. After executing "system device-mode update container=yes" command I did power on-off cycle with 5min, counting down on Terminal.
After trying to create new docker, Error pops out saying "Couldnt add Container - not allowed by device-mode(6)"
I tried to install docker on internal flash (>900MiB free).
Model:RB4011iGS+5HacQ2HnD
Firmware type: al2
Factory Firmware: 6.45.9
Current Firmware: 7.6
Upgrade Firmware: 7.6
Any thoughts what could be wrong?
Thanks, Rok
Re: how enable container on CHR\x86?
Posted: Mon Nov 21, 2022 7:07 pm
by pe1chl
On such a device you should just press the RESET button.
Re: how enable container on CHR\x86?
Posted: Tue Nov 22, 2022 7:48 pm
by kandar
Well that the other thing
push button is broken, accident happened
User manual says either power cycle or reset button.
Do you think reset button is more likely to work than power cycle. If so i could replace it, if that is the only way ....
Re: how enable container on CHR\x86?
Posted: Tue Nov 22, 2022 8:14 pm
by pe1chl
Maybe... at least when I wanted to set the device mode, I used the RESET button and it worked.
(actually I was surprised that it immediately rebooted the router - I was under the impression that the RESET button was merely an input line to the processor that can be polled, e.g. to detect if it has to reset the config or start the network bootloader, and that it would just see that I pressed RESET and set my devicemode without a reboot)
Re: how enable container on CHR\x86?
Posted: Tue Nov 22, 2022 10:28 pm
by kandar
I believe that is right, its not hardware reset button, but "soft" reset.... Anyhow, I can not find any information about that only push button works, but not power cycle.
Both options are always mentioned. Do either power cycle or reset via push botton.
Re: how enable container on CHR\x86?
Posted: Wed Nov 23, 2022 8:33 pm
by mkx
I can not find any information about that only push button works, but not power cycle.
I seem to remember that one MT staffer once (with distinctly low voice) admitted in a post I can't find that power cycle indeed doesn't work.
Re: how enable container on CHR\x86?
Posted: Tue Dec 06, 2022 1:59 pm
by kandar
[/quote]
I seem to remember that one MT staffer once (with distinctly low voice) admitted in a post I can't find that power cycle indeed doesn't work.
[/quote]
Well, I think I can confirm that power cycle does not work....
Rok
Re: how enable container on CHR\x86?
Posted: Thu Dec 15, 2022 2:48 pm
by 07adm
On AWS, after install container:
aws ec2 start-instances --instance-ids i-???
aws ec2 stop-instances --force --instance-ids i-???
I just love the idea. AWS first sends the ACPI shutdown, and in few minutes, if the instance is still up will cold-stop it. And idea presumably is to make the machine "swallow" ACPI command sending that immediately after start.
Unfortunately, I couldn't replicate this on my setup. And I'm doing that just a month later so I doubt AWS changed something.
I was testing on t2.micro. Used the AWS CloudShell to minimize the lag. I also tried to add arbitrary sleeps between start and stop, tried with and without "--force" -- it just shows "Stopping" for 5-10 seconds and stops, without giving me a chance to input anything to terminal.
edv4ld0, could you share more detail how you did that?
I am struggling with the same issue here. AWS support have advised that a "dirty shutdown" is not possible. Even using the force option listed in here.
If anyone has managed to recreate these steps, I would love a breakdown of how you managed it!
Re: how enable container on CHR\x86?
Posted: Sun Feb 12, 2023 11:36 pm
by fakeusername2022
I have the very same issue! Mikrotik must devise a different method for enabling container on x86 or CHR platforms.Some VPS providers perform a gracefull shutdown/restart of the system no matter what. Best to change the method for CHR version...
Re: how enable container on CHR\x86?
Posted: Mon Feb 13, 2023 10:45 am
by Sob
One way to solve it would be it they added confirmation at boot. It would require access to physical or virtual console, i.e. something that any attacker wouldn't have, so it would be safe. User would enable containers and do regular reboot. While booting, system would ask if they really want it (with e.g. 10 second timeout, defaulting to "no"). Anyone without access to console would be still out of luck, but many/most(?) have it, so it would better than now.
Re: how enable container on CHR\x86?
Posted: Fri Feb 17, 2023 11:01 am
by tsungkang
I have the very same issue! Mikrotik must devise a different method for enabling container on x86 or CHR platforms.Some VPS providers perform a gracefull shutdown/restart of the system no matter what. Best to change the method for CHR version...
I agree with it, I've seen many server provider not to expose all the control functions, their shutdown button will send shutdown signal instead of forcing power down, I had to give up using RouterOS on these vps servers.
Re: how enable container on CHR\x86?
Posted: Tue Feb 21, 2023 4:54 pm
by djubb
Only thing that worked for me to get it working on AWS, was to launch the cloud vm as an ubuntu/debian VM, then set up the chr with container enabled on another local vm with virtualbox or whatever, ssh the image over to a ramdrive on the ubuntu CHR, and then dd the image and reboot. But beware all of this wipes the license. Oh and I'm sure there's an easier way, but I don't know it
Good afternoon. Can you suggest how you did it?
I have exactly the same problem. I installed in hyper-v chr. How do I make image for transfer?
Re: how enable container on CHR\x86?
Posted: Thu Mar 23, 2023 8:42 pm
by nitrag
On AWS, after install container:
1) Stop EC2 (wait until it's stopped).
2) Using AWS CLI (one after the other):
aws ec2 start-instances --instance-ids i-???
aws ec2 stop-instances --force --instance-ids i-???
* On console in Instance state, it will be showing Stopping.
3) Connect to CHR using your favorite client, to enable the container:
/system/device-mode/update container=yes
The instance will shutdown between 3 and 4 minutes. Wait.
4) Start EC2, the log will appear:
router was rebooted without proper shutdown
* The container will be enabled.
I can confirm that this method works. However at about 2m30s in the countdown was still going and AWS had not terminated the instance. So I went to the console and issued a Force Terminate. It said it was successful. After no shutdown after 30 seconds I issued it again. Then I waited. It eventually stopped. I started and was happy to see that it was enabled. BTW, I used this guide to install v7.8 from RAW disk
https://bookstack.bluecrow.net/books/mi ... in-aws-ec2.
Re: how enable container on CHR\x86?
Posted: Sun Apr 02, 2023 12:07 pm
by gt4a
on aws lightsail, issued stop command with --force parameter did not work.
Re: how enable container on CHR\x86?
Posted: Sun Apr 02, 2023 9:40 pm
by Larsa
Did you use the cli to run both "start" and then "stop -force" right after?
Re: how enable container on CHR\x86?
Posted: Sun Oct 29, 2023 9:47 am
by zebka
Hi There, Exact Same Problem here.
in VM Manager Stop/Start or Restart doesn't work and the container never turns on. any recommend? tnx
Re: how enable container on CHR\x86?
Posted: Tue Dec 19, 2023 6:54 pm
by eki
On DigitalOcean "Power cycle" option worked.
Re: how enable container on CHR\x86?
Posted: Wed Feb 21, 2024 4:27 pm
by krosseyed
I am running into this issue on v7.12.1 on a t2.nano instance @ us-east-2 (AWS). The provided tricks previously posted in this thread have not worked out for me. Just to avoid covering the same ground twice, I can confirm that I have the container package installed and have tried the awscli trick to no avail.
Does anyone know if there is another way to emulate the reset button on AWS?
Re: how enable container on CHR\x86?
Posted: Thu Feb 22, 2024 9:04 pm
by kevinds
m8, Im shutting down my virtual machine in isp manager via "restart" and "stop" buttons
without any effect.
Is there a third option not in your screenshot? I've had to try them all, one at a time, on various cloud platforms, to get it to work..
Otherwise, extend the timeout way past 5 minutes and open a ticket for the provider to do it for you..
You need a power-off/reset without shutdown.. If it was a normal PC, would be holding the power button for 4 seconds to power off rather than pressing once to let it shutdown normally..
Re: how enable container on CHR\x86?
Posted: Sun Feb 25, 2024 4:34 am
by krosseyed
I was able to get device-mode set on AWS using a more reliable method than waiting on awscli to flake out. The idea is to create a snapshot of the instance during the 5 minute period and then to forcibly replace the running disk with the newly created snapshot, all from within the AWS web interface. I am sure you could automate this with awscli but I figure this would provide a simple way for users wanting to fully utilize RouterOS/CHR on AWS.
***Optional***
Create RouterOS AMI using the following guide:
https://bookstack.bluecrow.net/books/mi ... in-aws-ec2
1. Locate the Volume ID of your CHR by going to your AWS EC2 Console and navigating to Instances > Storage and locating the Volume ID near the bottom of the page
2. Install container package and update the device-mode using the following command and stay logged into the CHR:
/system device-mode update container=yes
3. Go to your AWS EC2 console and go to Snapshots, from there you will need to create a snapshot of the volume that you grabbed in step 1. Give it a memorable name.
4. Go back to Instances, select your instance, and on the top right go to Actions > Monitor and Troubleshoot > Replace Root Volume
5. You are going to choose Snapshot in the list of options and then select the snapshot from the list, you should be able to find it quickly by using the memorable name.
6. You will notice that you will be kicked out of your session with the CHR. You will need to reboot the instance from the console at this point.
This allowed me to run containers on my AWS CHR, so hopefully it will work for others that run into this snag.
Re: how enable container on CHR\x86?
Posted: Sun Apr 07, 2024 3:54 am
by NetHorror
Azure VM container enabling:
azure-hard-reset.png
1. VM control panel open "serial console"
2. press power button
3. select "reset VM (hard)"
Re: how enable container on CHR\x86?
Posted: Thu Apr 11, 2024 10:28 pm
by 2024Ro8iDi
Run a CHR in the local virtualization environment and enable the container, then package it and dd on the vps.
This is a proven and workable solution.
The most important thing is that this method is suitable for almost all cloud servers !!
If necessary contact me
Re: how enable container on CHR\x86?
Posted: Fri Jun 14, 2024 10:41 am
by djubb
Could you please provide a step-by-step explanation on how to "then package it and dd on the VPS"?
Thank you!
Run a CHR in the local virtualization environment and enable the container, then package it and dd on the vps.
This is a proven and workable solution.
The most important thing is that this method is suitable for almost all cloud servers !!
If necessary contact me
Re: how enable container on CHR\x86?
Posted: Sun Jul 14, 2024 6:40 am
by 2024Ro8iDi
To put it simply, it means saving a copy of the local disk image with the container environment enabled, and then dd it to the vps
Could you please provide a step-by-step explanation on how to "then package it and dd on the VPS"?
Thank you!
Re: how enable container on CHR\x86?
Posted: Sun Oct 20, 2024 5:57 pm
by fsardi
I was able to get device-mode set on AWS using a more reliable method than waiting on awscli to flake out. The idea is to create a snapshot of the instance during the 5 minute period and then to forcibly replace the running disk with the newly created snapshot, all from within the AWS web interface. I am sure you could automate this with awscli but I figure this would provide a simple way for users wanting to fully utilize RouterOS/CHR on AWS.
***Optional***
Create RouterOS AMI using the following guide:
https://bookstack.bluecrow.net/books/mi ... in-aws-ec2
1. Locate the Volume ID of your CHR by going to your AWS EC2 Console and navigating to Instances > Storage and locating the Volume ID near the bottom of the page
2. Install container package and update the device-mode using the following command and stay logged into the CHR:
/system device-mode update container=yes
3. Go to your AWS EC2 console and go to Snapshots, from there you will need to create a snapshot of the volume that you grabbed in step 1. Give it a memorable name.
4. Go back to Instances, select your instance, and on the top right go to Actions > Monitor and Troubleshoot > Replace Root Volume
5. You are going to choose Snapshot in the list of options and then select the snapshot from the list, you should be able to find it quickly by using the memorable name.
6. You will notice that you will be kicked out of your session with the CHR. You will need to reboot the instance from the console at this point.
This allowed me to run containers on my AWS CHR, so hopefully it will work for others that run into this snag.
WORKED LIKE A CHARM!!! I had tried rebooting, stopping the EC2 instance with no luck. Install the containers x84 package, and run in the virtual CHR the command after rebooting:
/system device-mode update container=yes
within the 5 minutes make a snapshot of the running instance (it sometimes takes a while but less than the 5 min), replace the root and reboot the instance in the EC2 console!!! I would guess you need to do all this in less than the 5 min or at least the snapshop has to be taken in less than the 5 min. Do backup the server before hand. I have had a CHR not boot after a hard reset!!