Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autorelabel fails on Vagrant image for VirtualBox #100

Open
schlomo opened this issue May 3, 2017 · 7 comments
Open

autorelabel fails on Vagrant image for VirtualBox #100

schlomo opened this issue May 3, 2017 · 7 comments

Comments

@schlomo
Copy link

schlomo commented May 3, 2017

Clone of https://bugs.centos.org/view.php?id=13213 which I put there because I didn't know better, thanks to @lpancescu for the intro to this repo.

We stumbled upon this in rear/rear-workshop-osbconf-2016#4 (comment) and you can use the Vagrantfile in https://gist.github.com/schlomo/b532ba9bca87ea40d922d90e62b7338c as a test case.

@lpancescu The reason to use autorelabel in the VM is that we use this VM to do backup and restore tests so that we actually restore the VM's content into a new VM with the help of https://github.com/rear/rear and then we need to trigger autorelabel to restore the labels upon the first boot.

@lpancescu
Copy link
Contributor

A serial console could be useful in some situations, and VirtualBox is the only one with a problem. Perhaps we could also enable the serial port for our VirtualBox image, and leave the cable disconnected. I hope to get some feedback from other VirtualBox users before removing the serial console from all virts.

https://lists.centos.org/pipermail/centos-devel/2017-May/015843.html

@schlomo
Copy link
Author

schlomo commented May 3, 2017

Is there a way to find out if the serial port is actually there? Then you could decide dynamically. If there is no serial port then don't configure serial console.

Maybe dmesg | grep ttyS0 is good enough?

@lpancescu
Copy link
Contributor

@schlomo Could you please try to enable the serial port from your Vagrantfile? Just as a test to see if the mere presence of a disconnected port would fix the problem. Something like:

config.vm.provider "virtualbox" do |v|
  v.customize ["modifyvm", :id, "--uart1", "0x3f8", "4", "--uartmode1", "disconnected"]
end

I hope I got the syntax right.

The console is a kernel boot parameter, set during the installation - not much we can do there.

@schlomo
Copy link
Author

schlomo commented May 3, 2017

Yes, that also helped. However, I see this very problematic as the user will have to know about it. A simple config.vm.box = "centos/7" won't be enough any more.

How about you modify the grub config during the installation if the VM runs on VirtualBox?

In any case I hope that this is only a temporary workaround till upstream removes the requirement of the tty in the rhel-autorelabel unit.

@lpancescu
Copy link
Contributor

@schlomo The installation is performed just once in qemu-kvm, and the resulting disk image is converted to several formats, for each Vagrant provider that we support. This was just a quick test to see if the presence of a disconnected serial port would prevent a hang during relabeling - it will be fixed on our side, without the users needing to make any changes to their Vagrantfile.

@schlomo
Copy link
Author

schlomo commented May 3, 2017

@lpancescu thanks a lot. Maybe have some code modify the grub config at first boot under VirtualBox?

Something like this could already be a workaround:

if ! dmesg | grep -q ttyS0 ; then
      sed -i -e 's/ console=[^ ]\+\?//g' /etc/default/grub
      grub2-mkconfig -o /boot/grub2/grub.cfg
fi

@lpancescu
Copy link
Contributor

@schlomo The Vagrant images v1704 were already released, just not visible on Atlas yet (I had built the release candidates this weekend). I'm afraid you'll have to wait until v1705, at the beginning of June.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants