Jump to content

VM Software Boot From Pre-Loaded Drive

Go to solution Solved by Windows7ge,

You can do this using QEMU/KVM. VMWare ESXi should be capable of it. Don't know about VMWare for Workstations, and Virtualbox I can say with relative confidence the answer is no.

Not 100% sure if this is where this belongs. My rational is: Asking If a program (Say Vmware or virtualbox) can do this thing involving a hard drive with an operating system on it.

I've very lightly used (maybe better to say tried?) Virtual machines in the past but never seen or heard of this use case so I wanted to see if it's possible as I will be consolidating my various lightweight/main computers/experiences into one computer that I will be building soon once the parts arrive. Basically I have a Lenovo mini computer running Ubuntu server 18.04 that I use to run my Minecraft Server. I am pretty sure I am capable of just creating a VM with clean Ubuntu, transfer the necessary files over, etc and do it that way. But I'm curious if it would be possible to plug my MC Ubuntu Server hard drive into my New computer via sata and just set up the VM to boot off of that drive as is. I figure I would intend on having that drive used exclusively for the Minecraft Server anyway so if this is possible then why not?

Any info on this topic would be much appreciated. Thank you.

Link to comment
https://linustechtips.com/topic/1174862-vm-software-boot-from-pre-loaded-drive/
Share on other sites

Link to post
Share on other sites

You can do this using QEMU/KVM. VMWare ESXi should be capable of it. Don't know about VMWare for Workstations, and Virtualbox I can say with relative confidence the answer is no.

Link to post
Share on other sites

Well you can shut down the VM so that opens a lot of options.

And Linux usually adjusts easily to a different platform.

 

As long as the virtual HDD can be read by whatever hypervisor you are planning to use, you will probably be fine.

If you want my attention, quote meh! D: or just stick an @samcool55 in your post :3

Spying on everyone to fight against terrorism is like shooting a mosquito with a cannon

Link to post
Share on other sites

17 minutes ago, Windows7ge said:

You can do this using QEMU/KVM. VMWare ESXi should be capable of it. Don't know about VMWare for Workstations, and Virtualbox I can say with relative confidence the answer is no.

Well I suppose for all intents and purposes you've answered my question. But let's say both Qemu/Kvm and VMWare ESXi can do it. Any reason to choose one over the other?

Features, overhead, user friendless, etc?

Link to post
Share on other sites

42 minutes ago, Windows7ge said:

You can do this using QEMU/KVM. VMWare ESXi should be capable of it. Don't know about VMWare for Workstations, and Virtualbox I can say with relative confidence the answer is no.

Actually, VirtualBox can do this (raw hard disk access), but it usually requires some manual editing of the virtual machine's files.

 

edit: Here's the documentation: http://www.virtualbox.org/manual/ch09.html#rawdisk

 

I've done this in the past where I dual booted between Windows and Linux. On Linux I had a virtual machine that started Windows from my physical disk. Let's just say I don't really recommend it due to some driver issues (real hardware vs virtual hardware).

Remember to either quote or @mention others, so they are notified of your reply

Link to post
Share on other sites

21 minutes ago, cleb said:

Well I suppose for all intents and purposes you've answered my question. But let's say both Qemu/Kvm and VMWare ESXi can do it. Any reason to choose one over the other?

Features, overhead, user friendless, etc?

They're both high performance/low overhead hypervisors. ESXi has a free standard license and QEMU/KVM is just outright free from the package manager.

 

I don't have experience with ESXi so I'm not the best person to ask. I do have a lot of experience with QEMU/KVM so I'm a little biased. :P

 

4 minutes ago, Eigenvektor said:

Actually, VirtualBox can do this (raw hard disk access), but it usually requires some manual editing of the virtual machine's files.

 

I've done this in the past where I dual booted between Windows and Linux. On Linux I had a virtual machine that started Windows from my physical disk. Let's just say I don't really recommend it due to some driver issues (real hardware vs virtual hardware).

Informative. I've never heard of it being a supported feature.

 

I will still make the argument though that at least on Windows the performance of VB is terrible compared to ESXi or QEMU/KVM. If he ever needs the Ubuntu server for compute he'll get better performance from it with a lighter weight hypervisor. There's also a number of knobs you can adjust with QEMU/KVM to improve the performance that I don't believe exist on VB.

Link to post
Share on other sites

9 minutes ago, Eigenvektor said:

Actually, VirtualBox can do this (raw hard disk access), but it usually requires some manual editing of the virtual machine's files.

 

edit: Here's the documentation: http://www.virtualbox.org/manual/ch09.html#rawdisk

 

I've done this in the past where I dual booted between Windows and Linux. On Linux I had a virtual machine that started Windows from my physical disk. Let's just say I don't really recommend it due to some driver issues (real hardware vs virtual hardware).

Well that's good to know.

I see your point about driver issues and that is a concern. While Linux definitely comes off as more adaptable to this sort of thing I'm sure it too will have some issues with it....perhaps it depends on what I can do about it/how easy that would be to deal with if that problem arises.

Link to post
Share on other sites

1 minute ago, Windows7ge said:

Informative. I've never heard of it being a supported feature.

I will still make the argument though that at least on Windows the performance of VB is terrible compared to ESXi or QEMU/KVM. If he ever needs the Ubuntu server for compute he'll get better performance from it with a lighter weight hypervisor. There's also a number of knobs you can adjust with QEMU/KVM to improve the performance that I don't believe exist on VB.

Well the documentation explicitly mentions it as an "expert feature". It's easy to mess up your disk with that, so no wonder they're not advertising it much.

I mainly use VB because it's easy to use, I'll not make any claims that it is superior to ESXi or QEMU/KVM in terms of performance.

 

2 minutes ago, cleb said:

Well that's good to know.

I see your point about driver issues and that is a concern. While Linux definitely comes off as more adaptable to this sort of thing I'm sure it too will have some issues with it....perhaps it depends on what I can do about it/how easy that would be to deal with if that problem arises.

Yeah, I think (hope) Linux should give you fewer problems in that regard. Also I essentially had an OS that I could boot inside the virtual machine or on my physical machine depending on my current needs. So essentially Windows would boot in a virtual environment one day and the physical machine the other day.

 

It worked reasonably well, but driver updates required additional care and when I booted on my physical hardware the VirtualBox tools would complain and I think it also messed with the clock, because Windows couldn't use UTC back then.

Remember to either quote or @mention others, so they are notified of your reply

Link to post
Share on other sites

2 minutes ago, Windows7ge said:

I will still make the argument though that at least on Windows the performance of VB is terrible compared to ESXi or QEMU/KVM. If he ever needs the Ubuntu server for compute he'll get better performance from it with a lighter weight hypervisor. There's also a number of knobs you can adjust with QEMU/KVM to improve the performance that I don't believe exist on VB.

Perhaps I should note that I intend on the Main OS being Linux as well (Deciding between Manjaro or Ubuntu as I have more experience with Ubuntu but really like Manjaro's interface, aesthetic, ect out of the box). But while performance is a concern to me I'm curious to know how much it'll matter in my particular use case. Would the performance be that much different using one or the other? Security is also a big question since I'm VMing for that reason...but maybe that is unnecessary to ask since it's all VMing.

Link to post
Share on other sites

3 minutes ago, Eigenvektor said:

Yeah, I think (hope) Linux should give you fewer problems in that regard. Also I essentially had an OS that I could boot inside the virtual machine or on my physical machine depending on my current needs. So essentially Windows would boot in a virtual environment one day and the physical machine the other day.

While I don't intend on that use case that's certainly and interesting thing to think about as I'm planing on dual booting windows for gaming (at least for when I'm intending to play with friends for best experience) but perhaps I could do something similar where if I find Vm usable for a scenario then I'll just do that and limit having to actually turn off my computer.......though that's a whole another can of worms.

Link to post
Share on other sites

1 minute ago, cleb said:

Perhaps I should note that I intend on the Main OS being Linux as well (Deciding between Manjaro or Ubuntu as I have more experience with Ubuntu but really like Manjaro's interface, aesthetic, ect out of the box). But while performance is a concern to me I'm curious to know how much it'll matter in my particular use case. Would the performance be that much different using one or the other? Security is also a big question since I'm VMing for that reason...but maybe that is unnecessary to ask since it's all VMing.

If you use Manjaro (based on Arch) I can't help much for tuning QEMU/KVM if you choose to use it. I have a VFIO guide for GPU pass-though on Debian (ubuntu) that would provide most of the instructions you would need to set this up. It doesn't include how to pass-through a drive though. It isn't too difficult. I believe it's doable through the GUI (virt-manager).

 

For your use case a minecraft server isn't a stressful application and most of the latency involved will probably be through your internet connection. Unless you plan to load it up with many many clients it probably won't impact you going either way.

 

Security wise the hypervisor uses what I believe is Ubuntu's SE Linux/AppArmor security application. You may also install UFW and open the ports necessary for Minecraft. Should block everything else.

 

Either way you'll have to create a network bridge as the default is NAT. Without this nobody will be able to connect.

Link to post
Share on other sites

2 minutes ago, Windows7ge said:

If you use Manjaro (based on Arch) I can't help much for tuning QEMU/KVM if you choose to use it. I have a VFIO guide for GPU pass-though on Debian (ubuntu) that would provide most of the instructions you would need to set this up. It doesn't include how to pass-through a drive though. It isn't too difficult. I believe it's doable through the GUI (virt-manager).

 

For your use case a minecraft server isn't a stressful application and most of the latency involved will probably be through your internet connection. Unless you plan to load it up with many many clients it probably won't impact you going either way.

 

Security wise the hypervisor uses what I believe is Ubuntu's SE Linux/AppArmor security application. You may also install UFW and open the ports necessary for Minecraft. Should block everything else.

 

Either way you'll have to create a network bridge as the default is NAT. Without this nobody will be able to connect.

I see.

It is apparent that I have very much more research to do regarding this topic and I'm afraid that it is extending past what I am willing to investigate atm. Again my purpose of this thread was just about the ability to VM boot off of a drive. With that said I appreciate your help and it is fortunate that my parts for the system will not arrive for some time so I do have time to do more research and will certainly bother you again when/if I find the need.

Link to post
Share on other sites

4 minutes ago, cleb said:

But while performance is a concern to me I'm curious to know how much it'll matter in my particular use case.

I've used it mainly for desktop stuff (e.g. Visual Studio in VirtualBox on Linux). There's definitely an overhead, but it wasn't that noticeable. The primary issue was I/O (e.g. installations took quite a bit longer). My CPU didn't have VT-d back then and I still used a HDD, so that may be less of a concern these days.

 

10 minutes ago, cleb said:

While I don't intend on that use case that's certainly and interesting thing to think about as I'm planing on dual booting windows for gaming (at least for when I'm intending to play with friends for best experience) but perhaps I could do something similar where if I find Vm usable for a scenario then I'll just do that and limit having to actually turn off my computer.......though that's a whole another can of worms.

These days I'm mainly on Linux and only use Windows for games that need it. The whole thing was more of a "can it be done" experiment. I didn't want to have to reboot to start the odd Windows program, instead simply starting it inside the virtual machine. Like I said I wouldn't recommend it because it was a bit of a maintenance nightmare :D A purely virtual Windows should be less of an issue. Not sure how viable that is for gaming though, haven't tried in a long time.

Remember to either quote or @mention others, so they are notified of your reply

Link to post
Share on other sites

1 hour ago, Eigenvektor said:

These days I'm mainly on Linux and only use Windows for games that need it.

Yeah you know it's come to my attention that less than ever there is a need for this (of course depends on who you are) so I'm hoping it doesn't end up being all that necessary but i can recall a time where I was the "friend who ran Linux" when we'd all get online to play games and I brought everyone down to my level.

 

1 hour ago, Eigenvektor said:

Not sure how viable that is for gaming though, haven't tried in a long time.

Again I've heard this has gotten better....but probably still not an ideal solution. But I could be surprised!

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×