Sign in with
Sign up | Sign in
Your question

On Linux and virtual Machines

Last response: in Linux/Free BSD
Share
February 11, 2007 11:40:47 PM

I am getting pretty sick and tired of having to reboot my computer every time I want to run a windows program (i.e. StarCraft) and although I know that it can be done via WINE, I figure it is about time I learn to use VMs. What I am wondering is, when I make and run a VM, won't it be much slower than if i had just rebooted to the other OS to begin with? I remember reading or hearing about a feature that QEMU has where it is supposed to get near identical performance to rebooting and switching to windows as long as you are simulating an x86 machine on an x86 box. Is there any truth to this? And also, does this ring true for VMware? I heard that VMware is a bit easier to set up than QEMU, so I'd like to start with that if at all possible.

Also, I just read something in another thread about if a VM gets a virus. They said you could "reload the snapshot". What exactly does that entail? Is it possible to use my current winXP installation as a 'snapshot' so that I don't have to install the OS again and take up more room on my hard drive, or is there no getting around that?

I know these are a lot of questions here, but I would appreciate even a partial answer to this post. Thanks.

-Zorak

More about : linux virtual machines

February 12, 2007 12:27:49 AM

If you have a modern CPU and a lot of RAM ( 1GB or more ) you can get decent performance out of QEMU or VMWare. The more RAM the better!

If you use QEMU you need the QEMU accelerator as well ( kqemu kernel module ).

VMWare also uses kernel modules that must be compiled during the install.
The process is automated but can be buggy sometimes.

Both QEMU and VMWare are good virtual machines and allow you to run most win32 apps as if you had a real machine however they are not good for gaming because the virtual VGA and sound card are not suitable for games.

I would encourage you to use them and experiment with them because it is a good learning experience :-D But do not expect any miracles.

When you create a virtual machine you also create a virtual HDD to install on. You can make copies of the virtual disk ( which is just a large file ) so that you can restore it if something goes wrong ( snapshots ). VMWare and QEMU have their own format.

You can use a physical disk with virtual machines however that is not recommended. If you try to use an existing windows disk the windows install is very likely to self-destruct.



WINE and Cedega are much better for games!

Check out:

http://appdb.winehq.org/appbrowse.php

http://transgaming.org/gamesdb/


Let me know if that answers your questions. :-D



Quote:
I am getting pretty sick and tired of having to reboot my computer every time I want to run a windows program (i.e. StarCraft) and although I know that it can be done via WINE, I figure it is about time I learn to use VMs. What I am wondering is, when I make and run a VM, won't it be much slower than if i had just rebooted to the other OS to begin with? I remember reading or hearing about a feature that QEMU has where it is supposed to get near identical performance to rebooting and switching to windows as long as you are simulating an x86 machine on an x86 box. Is there any truth to this? And also, does this ring true for VMware? I heard that VMware is a bit easier to set up than QEMU, so I'd like to start with that if at all possible.

Also, I just read something in another thread about if a VM gets a virus. They said you could "reload the snapshot". What exactly does that entail? Is it possible to use my current winXP installation as a 'snapshot' so that I don't have to install the OS again and take up more room on my hard drive, or is there no getting around that?

I know these are a lot of questions here, but I would appreciate even a partial answer to this post. Thanks.

-Zorak
February 12, 2007 2:19:27 AM

I haven't tried cedega just yet, and wine seems to work fairly well with starcraft, with the proviso that there is an almost imperceptible lag at the beginning of a game that gets progressively worse (to the point of unplayability), which I am thinking is strictly related to my graphics card issues.

I guess I was hoping that if I could run windows within a VM that I might be able to use windows drivers for my graphics card within that VM and not have horrible lag issues. Seeing as how StarCraft really isn't anywhere near as graphics intensive as Doom3 or FEAR or remotely close to Oblivion, I would think I should be able to get away with playing it there, yes? Or am I totally mistaken?

-Zorak
Related resources
February 12, 2007 2:43:10 AM

It wouldn't hurt to try it under VMWare and QEMU :-D

Since it does not use heavy 3D it may work reasonably well.

Have you tried all the latest patches for it by the way?


Quote:
I haven't tried cedega just yet, and wine seems to work fairly well with starcraft, with the proviso that there is an almost imperceptible lag at the beginning of a game that gets progressively worse (to the point of unplayability), which I am thinking is strictly related to my graphics card issues.

I guess I was hoping that if I could run windows within a VM that I might be able to use windows drivers for my graphics card within that VM and not have horrible lag issues. Seeing as how StarCraft really isn't anywhere near as graphics intensive as Doom3 or FEAR or remotely close to Oblivion, I would think I should be able to get away with playing it there, yes? Or am I totally mistaken?

-Zorak
February 12, 2007 2:53:16 AM

The latest patches for what? VMware or QEMU? I haven't installed either yet. As for my graphics card driver, as you well know, for some reason yum decides to go on a cigarette break every time i tell it "yum install kmod-fglrx" and reports some error about not finding enough mirrors to download from b/c apparently all of the ones it tries are either busy or the downloaded file md5sum doesn't match the repo md5sum. I am not sure why any of this is going on, but it is a tad discouraging since when I try to install the RPMs by hand, the kernel module won't load, and I am left without graphics support.

Oh well, sorry for digressing :p 

-Zorak
February 12, 2007 3:32:49 AM

Oh, well since I play starcraft online, that pretty much means that I HAVE to use the latest patch, since the others won't let you on battle.net if there is a newer patch out. Those really have had no net effect on my issue.

-Zorak
February 12, 2007 5:57:45 PM

The trouble with VMWare for games is that it emulates the graphics card so you don't get any hardware 3d support. I have no problem playing movies and the like with an XP VM but even 3d screen savers are slow. Certainly this is the case with the free versions. If you pay the money I believe they now offer direct access to the graphics card.

For every other application I really do like VMWare. As linux_0 says they do have kernel modules but the automated script is very easy to use. You just have to remember to run [code:1:25a69ade22]vmware-config.pl[/code:1:25a69ade22] if you update your kernel.

I'd say give it a go. It might be enough for the game in question. Personally I find it great for the bits I need to use once in a while like my web cam and nokia suite. I'm not a gammer though.
September 14, 2007 4:08:48 PM

I know this is a long inactive topic, but i thought i'd post my new question about VMs here instead of making a new/redundant thread.

I have this printer (brother mfc 210c), and basically it is a piece of ****. It only just barely works properly in windows, and in linux it worked a grand total of once after I installed the appropriate drivers for it. The thing is, every time my sister asks me to print something for her, i have to reboot into windows and it is VERY ANNOYING and very disruptive. So what I was wondering is if I install windows on a VM in linux, is it possible for that VM to communicate with peripheral devices like my printer? Or would making that work be a major pain in the ass? I plan on trying to fix this printer problem under linux eventually, but since I figure i've been wanting to tinker with VMs for a while, this might be a temporary fix to the rebooting annoyance. Any advice or help on this is greatly appreciated.

Also, as a word of advice NEVER EVER UNDER ANY CIRCUMSTANCES BUY A BROTHER MFC 210C! The box says that MFC stands for "multi function center", but in my experience it stands for something more along the lines of "mother f..." :fou: 

-Zorak

P.S. I'd get another printer, but it just isn't in the books right now.
September 14, 2007 6:06:33 PM

You can setup a VM running any flavor of windoze and share the printer.

:) 
September 15, 2007 5:05:17 AM

So that is, indeed, a confirmation that if I give the print order in the VM that the printer will actually proceed to work (or not work) as usual?

-Zorak

p.s. thanks for the quick response
September 15, 2007 1:57:36 PM

Not work is more like it but yes :) 

It will not work, or barely work, under a windows VM as it normally does on native windows.

Try QEMU or VMWare

:) 
September 15, 2007 5:00:53 PM

:D  Thanks man.

Last question: Between QEMU and VMWare, which is the better VM program? To make things easier i'll split this into sub questions:
Which is more stable?
Which is easier to use?
Which is more powerful?
Which will run my VM at speeds comparable to native (or full blown) installation speeds?

-Zorak
September 15, 2007 5:10:16 PM

Which is more stable?

probably both are about equally stable

Which is easier to use?

VMWare but QEMU is not far behind once you learn how to use it

Which is more powerful?

both are roughly equally powerful overall


QEMU is free and open source and supports more architectures.

VMWare is free, closed source has some extra "polish" because it's commercially derived from some open source and other components.


VMWare will get pretty close to native speed probably 90-99% depending on hardware support.

QEMU less so but it's reasonably fast with the kqemu kernel module.

:) 
September 15, 2007 5:13:06 PM

Oh yeah I use both :) 

Also VMWare has licensing restrictions.
September 16, 2007 3:33:36 PM

Quote:
I am getting pretty sick and tired of having to reboot my computer every time I want to run a windows program (i.e. StarCraft) and although I know that it can be done via WINE, I figure it is about time I learn to use VMs. What I am wondering is, when I make and run a VM, won't it be much slower than if i had just rebooted to the other OS to begin with? I remember reading or hearing about a feature that QEMU has where it is supposed to get near identical performance to rebooting and switching to windows as long as you are simulating an x86 machine on an x86 box. Is there any truth to this? And also, does this ring true for VMware? I heard that VMware is a bit easier to set up than QEMU, so I'd like to start with that if at all possible.


VMware has decent performance, but it's not native performance. You would need hardware virtualization support and a LOT of HDD speed to try to get near-native speed. My X2 4200+ and 4 GB RAM runs a VM at about the speed that a three-to-four-year-old computer would run it natively. Certainly usable, but not for anything that's super-intensive as it's a little laggy compared to native.

Quote:
Also, I just read something in another thread about if a VM gets a virus. They said you could "reload the snapshot". What exactly does that entail? Is it possible to use my current winXP installation as a 'snapshot' so that I don't have to install the OS again and take up more room on my hard drive, or is there no getting around that?


The VM is simply a large file on the HDD. You can back it up by simply copying the file. VMware also has a snapshot feature that basically does the same thing. So you can make a clean install, copy the VM file, and then when your running VM gets crapped out, switch to the copied file and you'll have a clean new VM. Think of it as running a disk-imaging program like Norton Ghost or using dd images but even simpler and faster.

Quote:
I know these are a lot of questions here, but I would appreciate even a partial answer to this post. Thanks.

-Zorak


I've had a bit of experience in doing this. I highly recommend that you look at running the VM from a fast HDD- go for a RAID 0 on 10000 or 15000 rpm HDDs or use a RAM drive like Gigabyte's iRam. VMs hit the HDD subsystem really hard. I have a 45 GB RAID 0 stripe on the first 15 GB of three 250 GB drives (through Linux md) and that provides a much better working environment than a single 74 GB 10000 rpm SATA drive. But even that gets hit pretty hard as well.
September 16, 2007 3:49:33 PM

Heh, thanks, that was a pretty comprehensive answer. I am pretty sure that my Q6600 should have support for hardware virtualization, so that may speed things up a bit. Currently I don't have enough disk space to do a raid setup like you suggest here, so i'd have to stick my VM on one of my hard drives by itself. When you say that it hits the HDD system hard, do you mean that it could potentially cause damage when under fair to heavy use? I wasn't really planning on using a VM that much, but I think it'd be good if i know the potential risks of using a VM.

-Zorak
September 19, 2007 3:38:11 AM

Zorak: For games, use Cedega... I play Battlefield 2 on there with no hassles at all. I'm pretty sure Starcraft is one of the heavily supported games on Cedega too! I found with VMware, I was about to achieve a faster then native (in a sense) setup as I didn't have to install so much crap into windows to protect itself... I just installed XP Pro, no service packs, bunged in my programs I needed to run (Solidworks 2007, Vegas 7.0, Rhinocerous 2.0 and EDTSim) and they all cruise faster then when I use to have then on my old Windows partition (May it die in agony!).


PS: First post in months.... So busy these days... argh...
September 23, 2007 10:32:30 PM

:) 

@knightrous

What version of the BF2 patch did you apply and what version of Cedega are you using?
September 28, 2007 4:20:59 AM

I was running Cedega 5.* and it was BF2 1.3.**. I can't remember exactly as I have upgraded Cedega since and I haven't played BF2 in a few months... Gaming has slipped down the past times list a bit lately.... Damn cars and robotics :lol:  The only hassle I ever had with BF2 on Cedega was that a few servers would Punkbust me online because of Cedega, but a lot of other ones didn't. It was hit and miss really, I could play for like 30mins in one round, then get booted, and other times I'd get booted after 30secs :sarcastic: 

But performance wise, I reckon it was better then on my Windows drive... Everything just seem that little bit smoother and massive explosions didn't cause as much lag as usual..Ubuntu probably wasn't sucking half my ram like XP :D 
September 28, 2007 10:53:05 AM

Ahh I see thanks :) 

I am asking because BF2 is notorious for having corrupt graphics.
September 30, 2007 11:09:43 PM

The only time I've ever had corrupt graphics in BF2 was with a ATI Radeon X600 in Windows :lol:  I bought my 6600GT after that and the problems went away.
September 30, 2007 11:27:02 PM

Interestingly, it doesn't like my 6600GT at all.

It might be the patch I installed.
September 30, 2007 11:58:51 PM

Things were a little laggy at first, but I realised I hadn't put in the nvidia drivers in Ubuntu properly, and when I did, things were much better :-) Ah your able to provide some print screenies of your graphics errors? Just want to see if they are the same at the Radeon ones :p 
October 1, 2007 12:58:59 AM

None of the text labels of any of the in-game buttons are readable.

So the game loads but I have no idea what to click on.

Cedega does note video corruption is common with BF2.
October 1, 2007 1:57:34 AM

Is your BF2 a CD or DVD installation? Post up your Cedega settings and I'll have a look at mine when I get home (Excuse for a few rounds of Kubra Dam ;-))
October 1, 2007 6:02:50 AM

Thanks :) 

It's DVD and I made the mistake (?) of installing the 1.41 patch.

If I have any free time I'll check my settings and post them.
October 2, 2007 2:56:09 AM

Ah. I haven't kept up to date with the patches after 1.3.*** Lack of time :p  Will update and see what I get...
October 6, 2007 7:27:57 PM

One other question for you guys, do you know if it is possible to access host OS files from the guest OS or guest OS files from the host OS?

I am trying to help my dad out with this. He still needs to use MS office and he just migrated to ubuntu and so I recommended VMware to run a windows VM for when he needs MSoffice, but i didn't know how to make files from one OS accessable to the other.

As a temporary work around I tried suggesting that he use a USB stick and connect it to the VM and then save files there and remove it from the VM and then access from the host, but I have been having a lot of trouble with that. I also managed to set up a samba share on the host OS so that the VM can access it, but that is a bit of a clunky solution. If anyone knows of a more "transparent" solution (i.e. one where he just saves a file to some location in the windows VM and it pops up somewhere in ubuntu), I'd really appreciate it.

Thanks

-Zorak

P.S He is thinking about buying crossover office to just use MSoffice, but i think there are other things that he may need windows to do, such as syncronizing his laptop with his IPAQ. so a solution to this problem may help us out more than with just MSoffice.
October 7, 2007 4:04:45 AM

Using samba, NFS or other network filesystems is probably the best way to do this.

VMWare offers to setup samba for you most of the time.

Sometimes you can mount the VM disk image as a disk in Linux and copy files back and forth but giving 2 operating systems concurrent access to the same virtual disk can cause major problems if it works at all.

You can certainly mount a virtual disk under Linux if it offline and in a recognizable format.

Samba and other network filesystem shares can be configured to mount automatically.

:) 
October 11, 2007 11:15:41 PM

Thanks so much for all the help. I got Samba set up and working for my dad and now he seems to be pretty happy with what he can do with VMware. I think overall he is having a pretty positive experience with Ubuntu, with the possible exception that he doesn't like crossover office as it is interacting strangely with MS office. I also managed to get a few of his little windows games working under Ubuntu via WINE, so he was pretty happy about that too.

Over all, I am pretty glad that I managed to keep him from wasting $2k on a freaking mac ( he swore he will never buy another windows system because he is so sick of windows crapping out on him), and in essence, he has just gotten a "new" computer out of the deal as his system will now run a bit faster and be safer and more stable :D 

-Zorak
October 11, 2007 11:35:51 PM

Awesome :) 

Good to hear!

Let us know if we can help.

:) 
October 11, 2007 11:42:44 PM

PS I would recommend rsync for your linux backups and it wouldn't hurt to save a copy of your VMWare virtual disk images for when windoze self-destructs.

:) 
October 14, 2007 9:16:28 PM

Question: When my dad's VM gets infected by a virus and goes kaput, at that point i should just be able to revert to an earlier snapshot and be back in business, yeah? Or do I have to make a copy of his entire virtual machine elsewhere to restore windows after it experiences a total meltdown?

Thanks.

-Zorak
October 14, 2007 10:04:21 PM

Find the multigigabyte .vmdk file or .vmd* file and then make a complete backup of the entire directory that file is located in.

The virtual disk may be split into 2GB pieces if you told VMWare to do so when you created the disk.

Using tar and gzip to archive the entire directory would probably be a good idea.

Then copy the file to another machine with VMWare, extract and test to make sure it works and for safe keeping. Drives die all the time.

If you are going to use the VM on more than one machine make sure you have licenses for each copy.

GL :) 
!