Convert Sata to Virtio?


Recommended Posts

So when I setup a VM a long time ago, I set it up on bus="Sata" instead of bus="Virtio".  I understand that Virtio will get better performance.  The disk type is "raw".

 

Is there any way to change this after the fact?  The drive is an OS drive.  I really can't rebuild this OS from scratch, as it's the primary HTPC currently.  I do have backups I can test any suggestions with.

 

Thanks.

Link to comment

So when I setup a VM a long time ago, I set it up on bus="Sata" instead of bus="Virtio".  I understand that Virtio will get better performance.  The disk type is "raw".

 

Is there any way to change this after the fact?  The drive is an OS drive.  I really can't rebuild this OS from scratch, as it's the primary HTPC currently.  I do have backups I can test any suggestions with.

 

Thanks.

Linux or windows guest?

Link to comment

I don't know if that is possible because Windows won't see the disk until virtio drivers are loaded. You can try this:

 

1. Make a backup of your Windows img file and current XML (copy your XML and save it somewhere).

2. Add a second hard drive of virtio type to your XML

3. Boot into your VM and you'll either be prompted for drivers for the 2nd hard disk or go to device manager and find the drive with the yellow exclamation point on it, right click on it, and install the virtio drivers. Now virtio drivers are installed and Windows should see your second hard drive.

4. Shut down the VM and change your boot drive from the current type to virtio.

5. Start your VM and hopefully Windows will update the drivers for the boot drive and boot up.

 

Again, I don't know if this will work. At least you'll have a backup of your img file and XML to restore if it doesn't.

 

Gary

Link to comment

I don't know if that is possible because Windows won't see the disk until virtio drivers are loaded. You can try this:

 

1. Make a backup of your Windows img file and current XML (copy your XML and save it somewhere).

2. Add a second hard drive of virtio type to your XML

3. Boot into your VM and you'll either be prompted for drivers for the 2nd hard disk or go to device manager and find the drive with the yellow exclamation point on it, right click on it, and install the virtio drivers. Now virtio drivers are installed and Windows should see your second hard drive.

4. Shut down the VM and change your boot drive from the current type to virtio.

5. Start your VM and hopefully Windows will update the drivers for the boot drive and boot up.

 

Again, I don't know if this will work. At least you'll have a backup of your img file and XML to restore if it doesn't.

 

Gary

This should work.

Link to comment

Caused my system to blue screen with "Your PC ran into a problem :("  Then it auto reboots.  Let it do that three times, to no avail.

 

Was able to revert back without having to restore from a backup.  I did change my target device from "vdc" to "hda".  Would that affect anything? Should I have left it at vdc?

Link to comment

I got it working!  Thanks for your help!

 

I tried it with leaving the device as vdc, but it still wouldn't boot.  I booted with no device passthrough (removed all qemu commands) and was able to get it to boot successfully.  Then added the passthrough items back and it worked! 

 

Then I was able to successfully apply jonp's SSD XML performance tweaks.

 

Thanks everyone!

Link to comment

I got it working!  Thanks for your help!

 

I tried it with leaving the device as vdc, but it still wouldn't boot.  I booted with no device passthrough (removed all qemu commands) and was able to get it to boot successfully.  Then added the passthrough items back and it worked! 

 

Then I was able to successfully apply jonp's SSD XML performance tweaks.

 

Thanks everyone!

 

Hmm, just to confirm so I understand here, were you passing through a GPU or other devices and that's what you removed and put back?

Link to comment

Yeah, basically, I have two VM XML's.  One with <qemu:commandline> section, and one without.  Other than that, they are identical.  The one without is so I can remotely access the VM at a bios/boot level to troubleshoot issues. 

 

I booted the one without, and it failed to boot once, but went into System Startup failure in Windows, instead of just the "Problem with your PC" error message and auto reboot.  I looked around but wasn't able to make any actual changes from CLI or and the auto startup repair failed.  But sometime during all of that, it must've installed the driver because then I rebooted it and it took me to the OS. 

 

I checked Device Manger, and the hard drive was now listed as a Red Hat SCSI device instead of QEMU Harddrive.  I shut it down, booted up my VM with the <qemu:commandline> lines, and it booted up successfully.

 

I then shut it down, made the changes to incorporate your XML SSD Performance tweaks, and booted it back up successfully.

 

The items that I have for passthrough are a USB controller, and an ATI HD7770 GPU.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.