0

I have a VM running under KVM hypervisor on a CentOS 7.3 server that was created with a LUKS-encrypted root partition. There are two partitions in the VM: /dev/sda1 is the boot partition and is unencrypted and /dev/sda2 is the encrypted partition with the root filesystem. The VM, when started, prompts for the pass phrase, which, when entered, decrypts the partition and boots the OS. That all works correctly.

What I would like to do is, with the VM not running, use guestmount to mount the VM's virtual disk as a mount point on the hypervisor's server and, thus, be able to manipulate the files on the filesystem. The command I'm using is

> guestmount -d encrypted_vm -i /mnt/vm

Upon issuing this command, I'm prompted for the passphrase, which I enter. An error message then appears stating that it couldn't find an OS which makes me wonder if it even tried to decrypt the disk.

Am I missing something or this is something which is just not supported?

sizzzzlerz
  • 123
  • 4
  • 1
    This ought to work, but your system hasn't been updated in over two years. Consider doing that yesterday. – Michael Hampton Apr 03 '19 at 00:17
  • Update: Both the hypervisor and the VM have been updated to Centos 7.5 but I'm still experiencing the same issue. Thinking about it, I'm guessing the message is correct since the encrypted partition doesn't have an OS on it. The kernel is in the /boot partition, which in not encrypted. Is there a way to tell guestmount where the os actually lives or to even not to bother checking for it. Simply mount the now-unencrypted partition. – sizzzzlerz Apr 12 '19 at 15:31
  • That doesn't make sense. What's on the encrypted partition, if not the OS? – Michael Hampton Apr 12 '19 at 15:41
  • Maybe I used bad terminology. The virtual disk does have two partitions, /dev/sda1 and /dev/sda2. sda1 contains the /boot directory which has the kernel, initrd, grub, etc.. The second partition is the / partition containing the normal OS directories, such as /usr, /etc, ... What I was trying to say was the guestmount may have been looking for the /boot directory on the now-unencrypted partition. Not finding it, it quits, printing out a message that it couldn't find an OS. Hopefully, that is a bit clearer. – sizzzzlerz Apr 12 '19 at 17:39

0 Answers0