After P2V Centos 7 how to install virtio drivers ?

SnakeP

New Member
Mar 18, 2024
12
0
1
Hi,
I try to make a p2v from physical centos 7 to vm but the vm is not working properly du to drivers problems i guess. How to install all drivers correctly ?
I used clonezilla to make the disk clone

Else how can I put back my datas if I make a centos 7 fresh install before ?

Thank you
 
It boots but after Login I get a "Oh No Something has gone wrong" and network does not work
 
boot from a boot disk an map the drives up to a mount point and then chroot into the mount point
remember to bind mount /dev /proc and /sys into your chroot and then dracut --regenerate-all --force
this will add the drivers to the initrd and all will be well on a reboot.


Code:
#Add a rescue ISO such as install-amd64-minimal-20230618T170201Z.iso and boot into the VM from it
#use lsblk to determine which subdirectories in /dev the partitions are stored
lsblk
#create directory to mount original filesystem to
mkdir /mnt/new
#mount the original filesystem
mount /dev/mapper/centos-root /mnt/new/
mount /dev/mapper/centos-home /mnt/new/home
mount /dev/sda1 /mnt/new/boot # boot partition
#if there is an EFI partition mount it at this stage
#don't need swap partition
#bind the system folders to the mount directory
mount  --bind /dev /mnt/new/dev
mount  --bind /proc /mnt/new/proc
mount  --bind /sys /mnt/new/sys
mount  --bind /dev/shm /mnt/new/dev/shm
mount  --bind /dev/pts /mnt/new/dev/pts
#chroot into the target filesystem
chroot /mnt/new /bin/bash  --login
#now you are in desired system with bash shell
#regenerate the bootloader
grub2-mkconfig -o /boot/grub2/grub.cfg
#regenerate the initrd's
dracut --regenerate-all --force
#exit chroot
exit
#power down the rescue system
reboot
 
Last edited:
  • Like
Reactions: SnakeP
Thank you damo2929 for help
I have no /dev/mapper directory at lsblk command. I get only:

sda1 >> boot
sda2 >> linux partition
sda3 >> swap partition
sda4 >> extended partition
sda5 >> linux partition

I mounted the sda2 partition and done all changes. The problem is still there
 
Last edited:
Thank you damo2929 for help
I have no /dev/mapper directory at lsblk command. I get only:

sda1 >> boot
sda2 >> linux partition
sda3 >> swap partition
sda4 >> extended partition
sda5 >> linux partition

I mounted the sda2 partition and done all changes. The problem is still there
you need sda2 and sda1 mounted into the right places

whats the output of lsblk?
 
Output is the one I told you (sda1 to sda5). No dev/mapper and no other details. The physical machine works normally as it. But the VM do not.

sda2 contains the filesystem and sda5 files to make work a 3D reco.
 
Last edited:
That's strange. The command give same result on physical machine and I cloned entire disk to VM
Normally CentOS will set up an LVM and put root on that. I think that is what @damo2920 was getting at.

After booting and the "something has gone wrong" message, you are able to run commands? Perhaps the name of the network device has just changed because it is in a different virtual slot than it was on the real HW.

ETA: Use "ip a" to view the status of your network devices. The actual driver is probably also different from what it was on the HW.
 
Last edited:
Ok now I can join the VM from local network. A last problem is there. I setup a GPU passthrough, the login displays well on a screen connected to the GPU but I have now no control on x session. How to mirror gpu display with a console ?
 
I reseted all network ifaces. Now I try to get a usable display. I can see display on my screen but it is the one connected to the gpu. No control at all to login
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!