RHEL 7 virtual console tip.

Share this link

If you don’t know the kpartx command, you miss something!

If you regularly play with virtual machines under KVM, you know that sometimes things go wrong.
A change in the /etc/fstab file or in the ssh configuration and you are in trouble, you can no longer access your virtual machine because you hadn’t set any virtual console: you need to reinstall it and it’s not fun!

But there is a solution! I call it emergency procedure.

This solution consists in stopping your virtual machine with the destroy command, then map your virtual machine image file in your physical host environment with the kpartx command. Mount the /boot partition and edit your /boot/grub2/grub.cfg file, adding the console=ttyS0 string at the end of every kernel boot line.
Finally, unmount the /boot partition, unmap your virtual machine image and reboot your virtual machine: from now on, you’ve got your virtual console!

This tip works at least for RHEL 6/CentOS 6 and RHEL 7/CentOS 7.

To get all the details, go to the RHEL 7 virtual console page.

Posted in RHEL7

RHCSA7: Task of the day

Allowed time: 5 minutes.
Configure a cron task to write the uptime at 2PM every day.

RHCE7: Task of the day

Allowed time: 10 minutes.
Change the SSH process configuration to only listen on the 443 port.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...

Archives