Jump to content

Running KSP in a Linux VM


dewin

Recommended Posts

Edit: Got this ALMOST working at acceptable framerates but with pretty severe graphical glitches, findings are in post #19

[sorry if this is the wrong forum for thus.]

I've decided that I'd like to be able to run KSP x64 -- and it's pretty well known how stable the Windows x64 builds are...

So I was pondering building a Linux VM for KSP (and Minecraft, but that's not relevant) -- as a bonus, it gives me an extra layer of protection in case I inadvertently install a malicious mod.

I have plenty of experience with virtualization and Linux (I work with both professionally), but I've never actually tried to play graphics-intensive games in a VM before. I know that I'll need a hypervisor that supports hardware accelerated graphics -- any suggestions? (Ideally free or low cost)

Alternatively, is there anyone running KSP in this arrangement who'd care to share the details of their setup and any observed pros/cons?

[No, I'm not interested in dual booting or making Linux my primary OS.]

Edited by dewin
Link to comment
Share on other sites

Why no dual boot ?

Just install Linux in a small partition (30GB is more than enough plus let's say 4GB Swap) ? A 64bit VM on a 32 bit OS (stick tongue) doesn't make things better. And i would guess dual boot is easier to maintain in cases of ... drawbacks.

KSP (fairly modded) runs perfectly stable and fast (for me) on (X)ubuntu, Mint, Debian ... under different Setups (yes, have bought more than one licence :-)). Mods i'm using: B9, KW, Scansat, Station Parts Ext., KJR, KAS, FAR, Karbonite(+), Proc. Fairings, Camera Tools, Raster Prop Monitor, NF Solar, Waypoint Manager.

- Notebook, 4GB Ram, i3, Intel 4400 Graphics. Lowest Graphics Settings.

- Laptop, 16GB Ram, i7, Xubuntu and Debian Wheezy, (XFCE, Gnome), Nvidia GT570M

- Desktop, X/Lubuntu, i7, 16GB, Nvidia GT660

Using the propriatary nvidia driver i even have AA.

Hope i could turn you to the dark side ...

Klaus

Link to comment
Share on other sites

Running games in a VM doesn't usually work very well. The big issue is that the VM doesn't have direct access to the video hardware for rendering, so your 3D performance is going to be terrible compared to running a dualboot. If you don't want to mess with repartitioning your hard drive, I would suggest following one of the many excellent guides for making a bootable usb stick and just boot off that. An 8GB stick is the minimum I would recommend, it should still be big enough for Linux, KSP, and all the mods you could want (~2GB for Linux, ~2GB for base KSP, so 4GB for mods).

As far as a hypervisor setup, I've heard of such things but from what I've heard such setups can be a huge pain to get everything working. The only free one I've heard of that might let you do what you're asking is Xen, which is itself is basically a minimal linux install to run the Xen utilities and then you run Windows and Linux as guests, and you would only be able to use your video card in one guest or the other. I don't have any experience with actually setting it up, I was looking for a similar thing awhile ago and came to the conclusion that there's really no good way to do it with virtualization, dualboot (or a bootable thumb drive) is much simpler and is guaranteed to work.

Link to comment
Share on other sites

The main issue with KSP is with memory hogging, which will increase given the overhead of running two OS simultaneously. So try only if you have RAM to spare.

I normally use virtualbox for my vm's, with the guest-additions installed.

If I remember correctly, Unity doesn't support 64-bit outside of win-64 and the only change between both ksp is the libraries used (either lib32 or lib64). Can't say much about the RAM usage though, never had a memory issue with ksp and I use ksp.x32.

Link to comment
Share on other sites

I personally know no hypervisor for windows, which is able to accelerate graphics in a way, that gaming works.

On the Linux side, KVM an Xen both are able to pass-through real pci(e) hardware to the guests. Also video cards. My current setup works that way. Gentoo for everything except of windows games. Those run in a VM.

So if you are using Windows as your hostos, you're lost.

Link to comment
Share on other sites

(Forums ate my first attempt at this post, take 2!)

Why no dual boot ?

Just install Linux in a small partition (30GB is more than enough plus let's say 4GB Swap) ? A 64bit VM on a 32 bit OS (stick tongue) doesn't make things better. And i would guess dual boot is easier to maintain in cases of ... drawbacks.

I specifically don't want to dual boot because I want my Windows environment to continue to be available while playing KSP. The reasons are personal, not technical -- I'm more than capable of setting it up but I'm looking for an alternative.

Running games in a VM doesn't usually work very well. The big issue is that the VM doesn't have direct access to the video hardware for rendering, so your 3D performance is going to be terrible compared to running a dualboot.

Some versions of VMWare claim support for hardware acceleration in the guests, though it's unclear as to whether that applies to any of the free versions. As noted above, there's reasons I don't want to dual boot (mainly the 'rebooting' part.)

The main issue with KSP is with memory hogging, which will increase given the overhead of running two OS simultaneously. So try only if you have RAM to spare.

12GB available, so I could easily give the guest 6-8GB.

If I remember correctly, Unity doesn't support 64-bit outside of win-64 and the only change between both ksp is the libraries used (either lib32 or lib64). Can't say much about the RAM usage though, never had a memory issue with ksp and I use ksp.x32.

Modded KSP installs can start causing memory issues (fairly quickly with large part mods), and and running KSP's 64-bit Linux build seems to be the recommended way around them if other efforts don't work (AdvancedTextureManager, etc.)

Link to comment
Share on other sites

I personally know no hypervisor for windows, which is able to accelerate graphics in a way, that gaming works.

VirtualBox supports 3D acceleration with the guest additions. I'm not sure how well this works for KSP, but it seems to work okay for the Win8.1 VM and the few crappy Windows Store games I've tested it with.

What it doesn't support, oddly enough, is 2D acceleration.

Link to comment
Share on other sites

My experience with VMs + games: Don't

The performance penalty of the extra layers of abstraction will make you scream in agony, almost as much as your kerbals normally do. The only benefit I can see here is the memory-usage, but you're going to need loads to make up for the fact that you'll be running 2 OSes in addition to KSP itself.

Seeing as you have plenty of professional linux experience you should be aware of how trivial it is to set up a dual boot, or just install it on a flash drive and run from there, if you prefer.

Also, as someone else said, I've never heard of a malicious mod either.

Link to comment
Share on other sites

I know you don't want to go dual boot, as you mentioned. This will limit you though.

I run Cinnamon Mint 64, works like a charm. (My KSP takes 4.5GB in the VAB, without a stutter.)

Second best option would be to make a bootable USB drive with linux on it. Although that also doesn't cover your needs 100% (being able to use windows whilst...)

Tough one.

Link to comment
Share on other sites

I specifically don't want to dual boot because I want my Windows environment to continue to be available while playing KSP. The reasons are personal, not technical -- I'm more than capable of setting it up but I'm looking for an alternative.

I'd just play under windows, then ... am a follower of KISS.

:-)

K

Edited by kemde
Link to comment
Share on other sites

Many VMs claim to provide 3D acceleration, but it is very limited and flat out doesn't work on a lot of 3D games due to driver issues because the VM doesn't see your AMD/Intel/Nvidia GPU, it sees a generic virtual video device and anything beyond simple games (like from the windows store, even some of those may not work correctly) will likely have issues, not to mention the performance penalties. The best integration I've seen with this is Parallels for mac (it actually allows you to play some proper 3D games from what I've heard), but that's for running windows on a Mac, I haven't heard of a similar option that works quite as well for running linux on windows with decent 3D performance.

Another thought: With the correct settings I've gotten 32-bit KSP remarkably stable on windows even with a lot of mods and visual improvements. If you use the -force-opengl flag, you can save an entire gigabyte of RAM on just the stock game. I've heard that some people have reported performance problems with it, YMMV but it works well for me. Also try deleting parts that you don't use from the gamedata folder. There's a mod called autopruner (link is on the SETI page in my signature) that supports batch renaming which effectively hides the parts from the game so you can still easily get the parts back if you want.

Link to comment
Share on other sites

I specifically don't want to dual boot because I want my Windows environment to continue to be available while playing KSP. The reasons are personal, not technical -- I'm more than capable of setting it up but I'm looking for an alternative.

Boot in a Linux and run Windows in a VM.

And if you don't own the hardware don't assume that the contends of a local VM cannot be discovered by a sys admin.

Link to comment
Share on other sites

Many VMs claim to provide 3D acceleration, but it is very limited and flat out doesn't work on a lot of 3D games due to driver issues because the VM doesn't see your AMD/Intel/Nvidia GPU, it sees a generic virtual video device....

I can confirm this is the case for VirtualBox running a guest GNU/Linux system on my Win7 box at work. The hardware (a decent AMD card from a couple years back) is only exposed as an "InnoTek GmbH VirtualBox Graphics Adapter." And the 2D acceleration only works for Windows guest systems. YMMV.

The best integration I've seen with this is Parallels for mac (it actually allows you to play some proper 3D games from what I've heard), but that's for running windows on a Mac

Parallels for Mac is the greatest thing since sliced bread. As far as I could tell it provided direct hardware access to the guest, and its hardware pass-through worked just as well for Ubuntu as it did for Win7. VMWare's solution was equally capable when I last used it (a version or two ago). Until I finally caved and bought a new Windows box to game on, I played graphics-heavy games through one of those two via Windows as a guest on OS-X. That doesn't help the OP much, though.

And running KSP on Linux isn't a panacea - there are still oddities and minor quirks just like there are on Windows. But the only way to figure out if it works for you at all is to try it. Just remember us and report back when it works out. ;)

Link to comment
Share on other sites

It looks like Virtualbox may have proper 3D acceleration support, it's just disabled by default as it's "experimental". Presumably it presents itself as a generic video adapter if disabled.

I'll be trying this when I get home tonight, though there's going to be a lot of other overhead (Like figuring out Steam for Linux, whee!). I'm hoping I can get the two KSP installs to share the same space, but we'll see -- one problem at a time.

Link to comment
Share on other sites

It looks like Virtualbox may have proper 3D acceleration support, it's just disabled by default as it's "experimental". Presumably it presents itself as a generic video adapter if disabled.

Interesting. Of course we're about 28 versions and half a century behind the one linked (assuming the current manual is for the current version), so it's unlikely it'd work for me _at_ work if it's something recently fixed. Scuttlebutt was Oracle only has a handful of maintenance devs on the VBox project now, so who knows if they've got the right personell to ever pull that out of "Experimental." I might just try that at home some weekend.

Edited by Cydonian Monk
Link to comment
Share on other sites

Steam for Linux is very simple to set up if you use an Ubuntu derivative (I recommend Linux Mint), you can install it from the software center or download a .deb package installer and everything seems to just work without messing around too much. The big issue with gaming on Linux for me is getting the graphics driver up and running, although that's gotten a lot better in recent years and most Ubuntu derivatives will autodetect your card and provide an easy way to automatically download and install the driver (unless you're running this on a laptop with nvidia optimus anyways).

Link to comment
Share on other sites

I help run a Minecraft Adventure Day Camp during the summer. Last year we tried running a VM software with MinecraftEDU. There was plenty of RAM, but the video card made the lag terrible and there were graphics glitches everywhere. We decided to just stick with the old "use this account on the computer" option.

Of course, I am talking about a single-computer connecting to all the others, which is probably different from what your describing.

Link to comment
Share on other sites

Here's an update:

I opted for the latest Linux Mint for my testing.

Virtualbox

Virtualbox claims accelerated graphics, and they certainly felt reasonably 'snappy' during the install process. It also worked with Virtualbox out of the box, including proper sharing of mouse/keyboard and being able to resize the VM window and having the VM's desktop scale accordingly.

However, KSP ran at a crawl (seconds-per-frame speed, as opposed to frames-per-second). I fiddled a bit -- but even after confirming that hw acceleration was, in fact, happening -- no luck.

VMWare Player

Free for personal use, which is all I'm doing here. (Otherwise it's an evaluation).

Much more of a headache to get setup, but KSP started much faster and definitely had proper acceleration going on -- though I also had some impressive graphical glitches, like sometimes having a hall of mirrors-effect (the background of the scene not redrawing properly) and, at one point, everything being rendered on a solid white background.

Oh, also, KSP doesn't think it can run at 1920x1080, but this might be due to the VM not having the full screen real estate available (due to VMWare player's window chrome). This is minor and probably easily fixable.

Also, Steam launches the x86 client by default, but the x64 client is also available.

Will need more tinkering to see if this is remotely feasible... also, while it's getting accelerated, it's probably still not as fast as running native.

I'll tinker more to see what I can find out.

Observed graphical glitches:

Vessel background doesn't update when there's no objects in the background (e.g. ship in Kerbin orbit, looking away from Kerbin). This causes the vessel to render on top of previous frames until a body comes into view. (Fixed by turning off Edge Highlightting (PPFX))

Making any change to graphics settings hangs the game for a long time

Space Center models are basically partially-rendered wireframes, unless I zoom in close to one -- which causes other issues. (Fixed by turning off Edge Highlightting (PPFX))

Space Center looks extremely ugly, with lots of z-fighting.

Large chunks of the VAB UI don't display, including buttons for categories and the background behind parts. (Fixed by Force Fallback Shaders, but that breaks most of the text.)

Edited by dewin
Link to comment
Share on other sites

Observed graphical glitches:

Vessel background doesn't update when there's no objects in the background (e.g. ship in Kerbin orbit, looking away from Kerbin). This causes the vessel to render on top of previous frames until a body comes into view. (Fixed by turning off Edge Highlightting (PPFX))

Making any change to graphics settings hangs the game for a long time

Space Center models are basically partially-rendered wireframes, unless I zoom in close to one -- which causes other issues. (Fixed by turning off Edge Highlightting (PPFX))

Space Center looks extremely ugly, with lots of z-fighting.

Large chunks of the VAB UI don't display, including buttons for categories and the background behind parts. (Fixed by Force Fallback Shaders, but that breaks most of the text.)

I wouldn't blame those issues on the virtualization. I had the same issue on my linux install until i started using the official nvidia driver instead of the open source driver.

Link to comment
Share on other sites

I wouldn't blame those issues on the virtualization. I had the same issue on my linux install until i started using the official nvidia driver instead of the open source driver.

I suspected they were driver-related as well, but in my case I'm using VMware's video drivers inside the VM so it might not be that easy.

That said, nVidia cards are horrendously buggy -- an issue the drivers mostly patch around. The best example of this I've seen is when WoW first released a 64-bit client: tons of minor graphic issues, fixed by... renaming wow64.exe to wow.exe so that the drivers could apply the correct game-specific fixes. (Renaming games to hl2.exe has been suggested fix in other cases, as well.)

I'll tinker more after work today.

Link to comment
Share on other sites

It's not just Nvidia cards, I've had similar issues with ATI cards, but updating ATI drivers has historically been much more painful than with Nvidia. Both companies have gotten a lot better in recent years from what I've observed though, especially in terms of Linux support. Both WoW and hl2 are old games now and not particularly relevant to the current state of affairs, especially given that the current GPUs are entirely different architectures from what was being used in that era.

Unfortunately, unless you have a VM that supports pci-e hardware pass-through you're not going to be able to use those GPU drivers. Without direct hardware access, the VM guest can't even see your actual video card, only the generic video adapter interface that the VM software provides so even if you managed to get the drivers installed they wouldn't actually do anything.

That said, it looks like VMware may support passthrough, take a look at this, but I'm not sure it works on the free version.

Link to comment
Share on other sites

  • 1 month later...

I think I'm about to give Mint 17.1 under Parallels a while (late 2013 macbook pro, 16gb)... if anyone has the knowledge to warn me off before I dump time into it, it would be appreciated :). Otherwise, I'll post results.

Love my kerbals... just isn't playable on mac anymore.

Link to comment
Share on other sites

While gaming in parallels on a mac using windows works reasonably well from what I've heard, I don't know how well the 3D acceleration for Linux works. Still, setting up a VM doesn't take all that long and I would be curious to hear how well Linux fares.

If you have an extra copy of windows (or if not, windows 10 is still in beta and free at the moment) that might be another option if Linux gives you issues.

Link to comment
Share on other sites

If you have an extra copy of windows (or if not, windows 10 is still in beta and free at the moment) that might be another option if Linux gives you issues.

The whole point of this is to be able to run 64-bit KSP, which only runs stable in Linux.

(As for me, I realized all's I did on my home PC was play indie games that all have Linux builds and browse the internet -- and discovered I had an 80GB partition just set aside anyways.. so I just went to dual-booting. Haven't been in Windows for weeks, unless I'm at work.)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.   Paste as plain text instead

  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.

×
×
  • Create New...