Whoap! SELinux Error at Boot for Linux? We got you!
-
Sometimes, tinkering with configurations and commands can go awry. For example, when you’ve made some modifications to SELinux in a virtual machine (VM) in Azure. Suddenly, “Failed to load SELinux policy, freezing.” pops up. But don’t worry, we’ve got the cure.Read the article by Florent Appointaire, Microsoft Engineer, to learn how to quickly solve the SELinux error at boot for Linux in Azure.
-
That's not really a cure, it just turns it off. The better thing to do is boot into recovery mode by adding
rd.break
at the end of that same line in the bootloader. Then remount the sysroot directory withmount –o remount,rw /sysroot
. Enter /sysroot withchroot /sysroot
and completely disable SELinux by settingSELINUX=permissive
in/etc/selinux/config
. Then creating the autorelabel file in / withtouch /.autorelabel
. Then exit the chroot. Reboot and let the system and let SELinux relabel everything. Check your logs to make sure there aren't any issues and then finally re-enable SELinux by settingSELINUX=enforcing
in/etc/selinux/config
. Then reboot again.Edit: forgot the chroot.
-
@stacksofplates said in Whoap! SELinux Error at Boot for Linux? We got you!:
That's not really a cure, it just turns it off. The better thing to do is boot into recovery mode by adding
rd.break
at the end of that same line in the bootloader. Then remount the sysroot directory withmount –o remount,rw /sysroot
and completely disable SELinux by settingSELINUX=permissive
in/etc/selinux/config
. Then creating the autorelabel file in / withtouch /sysroot/.autorelabel
. Reboot and let the system and let SELinux relabel everything. Check your logs to make sure there aren't any issues and then finally re-enable SELinux by settingSELINUX=enforcing
in/etc/selinux/config
. Then reboot again.Nice, seriously what are they expecting from MS engineer