Linux – Selinux interfering with vboxwebsrv or phpvirtualbox

fedoralinuxselinuxvirtualbox

I have a brand new installation of Fedora 18, with a brand new installation of Virtualbox 4.2. I have spent a painful few hours trying to get phpVirtualBox working. Apache 2.4 and PHP 5.4 are installed, along with the phpVirtualBox software. Attempting to access phpVirtualBox allowed me to login, but then I'd have a prolonged wait until an 'Error fetching HTTP headers' message appeared.

Finally, I set SeLinux to permissive, and Bingo! things start to work. For some reason the SeLinux Troubleshooter isn't flagging any messages from SeLinux, I don't know what to look for now.

This is a development box so I could leave SeLinux set to permissive but I will need to make this work in anger on the next project.

My question, then, is this: What changes to SeLinux policies do I need to make to allow phpVirtualBox and vboxwebsrv to work together?

If there's more information I can post that will assist I'll gladly post it – just let me know what it is.

Best Answer

Depends on a lot of things. Here's something you can try:

ls -lZ 

where ever phpVirtualBox is installed, and check the selinux security context. If its installed in /var/www/html, then the context should be

unconfined_u:object_r:httpd_sys_content_t:s0

If its isnt, you can set it with

restorecon -R /var/www/html/phpVirtualboxFolder

If its somewhere outside of /var/www/html, then its possible that you just need to tell selinux that its web content you are serving from there. e.g.

semanage fcontext -a -t httpd_sys_content_t “/path/to/phpVirtualBoxfolder(/.*)?”

But as dawud says, AVC denials from /var/log/audit/audit.log would be very helpful.

Related Topic