Whoap! SELinux Error at Boot for Linux? We got you!



  • alt text
    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 with mount –o remount,rw /sysroot. Enter /sysroot with chroot /sysroot and completely disable SELinux by setting SELINUX=permissive in /etc/selinux/config. Then creating the autorelabel file in / with touch /.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 setting SELINUX=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 with mount –o remount,rw /sysroot and completely disable SELinux by setting SELINUX=permissive in /etc/selinux/config. Then creating the autorelabel file in / with touch /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 setting SELINUX=enforcing in /etc/selinux/config. Then reboot again.

    Nice, seriously what are they expecting from MS engineer


Log in to reply