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

Leave a Reply

Be the First to Comment!

Notify of
wpDiscuz

RHCSA7: Task of the day

Allowed time: 10 minutes.
Create a XFS file system of 100MB. Mount it under /mnt. Then, increase its size by 50MB.

RHCE7: Task of the day

Allowed time: 10 minutes.
Configure a system to forward all email to a central mail server at 192.168.1.1 (change the IP address accordingly).

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 ...

Recent Comments