Gaming on linux virtual machine

Run Windows inside a virtual machine on Linux for gaming

This is a feature usually used to pass though special cards, 10 Gbit NICs etc, but it should also work for graphics cards.. Graphics manufacturers want us to buy dozens and dozens of cards and virtualising hurts that aim.

Run Windows inside a virtual machine on Linux for gaming

Since making the full time move to using Linux (Fedora) from Windows, I’ve found the migration fairly easy and haven’t had much disruption in how I do my work.

However, there are some games I like to play such as Football Manager and some older games which rely on 3D rendering (either software or hardware). At the moment I have a VirtualBox VM running Windows XP and 95% of the games I’ve installed on this have failed to run due to problems with the graphics card (the virtual graphics card).

What I would like to do is get the VM to use the laptop’s actual physical graphics card directly, or something similar. I know there is a performance issue, but most of the games I play are over 5 years old and I’m not bothered about graphic quality etc. I just want it to work.

I don’t have to use VirtualBox, I just used it because I’m used to it. If VMWare or another virtual technology is a better option than VirtualBox then I will use it.

VMs, by definition, cannot use the actual graphics hardware. It’s being used by the host so the guest can’t use it too. That’s just how it works. You can get better performance by installing the DirectX additions though.

You will need to install DirectX as an add-on for VirtualBox for it to work, but it does work.

To install DirectX, you need to boot the guest into safe mode. Boot your Windows VM into safe mode and go to VBoxGuest additions. Install the Direct3D additions. It has to be done in safe mode or it won’t work.

Install the VirtualBox Guest Additions on Windows, and enable «Display → 3D Acceleration» in the virtual machine properties.

You can actually pass through the graphics card to a windows guest, but you have to use something like Xen 4. The biggest caveats to this setup are that you need some patience and knowledge of hardware and linux, and the host OS cannot use the graphics card at the same time as the guests. Generally speaking, you need either scripts to manage moving your card from guest to host and back, or you just pipe it to the guest and access the host through ssh/cygwin X forwarding, etc. Not for the feint of heart, but shouldn’t be more than a weekend project for an experienced tech. I have multiple graphics cards passed through to different guests using Xen 4 on top of Fedora, and it really wasn’t that bad. Recompiling the kernel to add vt-d support was the thing that took the longest amount of time, but if you’re comfortable recompiling your kernel, you should be able to get it to work.

Читайте также:  Python3 pip alt linux

The information out there about requiring FLReset/Function-level reset is old and bogus; neither of my devices have it and they work fine.

Windows Gaming VM on Linux with GPU Passthrough, In this video, I show step by step how to set up a Windows VM on CentOS for gaming . This is the hardware I will be using in this tutorial:Processor: Intel C

Run Windows inside a virtual machine on Linux for

Run Windows inside a virtual machine on Linux for gamingHelpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith thanks & praise to

Running Windows in Linux: VirtualBox Configuration

Installing VirtualBox 6.1 in Linux and setting up a Windows virtual machine with Guest Additions, shared folders, shared clipboard and USB support.The proces

Windows Gaming VM on Linux with GPU Passthrough

In this video, I show step by step how to set up a Windows VM on CentOS for gaming . This is the hardware I will be using in this tutorial:Processor: Intel C

Is it possible to use gpu directly from virtual machine on ubuntu?

I’m Ubuntu user and i’d like to install windows and get directly access to gpu (NVidia 1060 6 Gb) to unity 3D and gaming, i’ve read a lot of information about this possibility on internet but i didn’t find something usefull.

I’ve tried to use virtualbox — in virtualbox it’s impossible to to something like that, i’ve installed vmware pro during creation vm i shared 3GB of GPU, but it still virtual and i have some freezes and problems with it.

May be i should use another software for virtualization or i just haven’t full image of it. I’ll be very thankfull for information.

You can do this in VirtualBox with the Guest Additions installed. It requires a processor with virtualization instructions and the instructions enabled in BIOS.

In the VirtualBox manager, adjust the settings of your VM by going to Settings → Display → Screen and ticking the following checkboxes:

For details and limitations, see these sections of the VirtualBox manual:

  • 4.5.1. Hardware 3D Acceleration (OpenGL and Direct3D 8/9)
  • 4.5.2. Hardware 2D Video Acceleration for Windows Guests

If you still have trouble, you might want to consult nVidia’s Virtual GPU Software User Guide.

The Complete Guide to Speeding Up Your Virtual, On VMware, select the Install VMware Tools option in the virtual machine’s menu instead. In Parallels, click Actions > Install Parallels Tools. Follow the instructions on your screen to complete the installation. If you’re using a Windows guest operating system, it’ll be just like installing any other Windows …

Is there a virtual machine with direct access to CPU and GPU for gaming?

Sorry for the long question.

With the coming of Steam for Linux I may have been over optimistic and got rid of windows installation. The problem is that I have about 100 Steam games that are not (and may never be) ported to Linux. Anyway I got tired of dual boot, and Wine solutions (wineprefix and playonlinux) don’t always work. So I was wondering if there is any solution to use a virtual machine (or something similar) with direct access to hardware spec in order to run windows games in it. (something like what Parallels do on mac). Re-installing windows is not a huge problem but I was hoping to avoid it as I would like use Ubuntu as my everyday OS together with more «difficult» distros..to learn more about Linux.

Читайте также:  Astra linux принтер перестал печатать

Edit: Thanks for all your answers: I’ll think about the solution you proposed. Honestly to this day I never heard of Xen, so I’ll have to read about it. and maybe buy a new graphic card. and a new monitor. I think I’ll end up re-installing windows on one of my drives. It’s a pity though. thanks again.

The short answer is: No.
The longer answer is: Not yet.

VBox’s 3D support barely counts. It does provide 3D support but absolutely no performance. VMWare seems to perform a lot better (note the benchmark is on a Mac) and that might be playable. The downside here is a large pile of cash (I’m not sure what 3D support is like in their free offerings).

But if you want to take full advantage of your hardware for Windows-only games, there’s only one solution and that’s to boot into Windows. I’m afraid to say that’s likely always going to be the case for that subset of games.

The only other near-acceptable solutions available:

  • Fight Wine (when it does work, it tends to work really well)
  • Buy a console.
  • Lobby the developer for a port.

There are all sorts of server technologies that may filter through in time :

  • Nvidia+Vmware are working on a multi-head virtualised gaming platform but I honestly don’t expect this level of integration to be in consumers’ hands for another decade, if not longer. Graphics manufacturers want us to buy dozens and dozens of cards and virtualising hurts that aim.
  • You could reverse it and have a Windows Server host VM and paravirt a Ubuntu desktop, with shared 3D but again, I’m not sure what the performance would be like. And it’s a ton of cash to do legally. The desktop-host isn’t as good at all.
  • Xen won’t paravirt a Windows install, so there’s no point looking there yet. It does have PCI and VGA passthrough modules but they’re locked to one VM so you’d have to have a graphics card for each install. Urgh.

Note I’m really only talking about 3D graphics here because the rest are solved or nearly-solved problems. CPU virtualisation is mature with paravirtualisation and CPU extensions like Intel VT-x and AMD-V. Peripheral passthrough is fairly low bandwidth so is simple to share.

Graphics are lagging because sharing them in the way we’re talking about is not a commercial necessity for manufacturers. It does seems to be going that way though (for high-end render farms and server-based workstation consolidation) so watch that space.

If both your hardware and your software support IOMMU (a.k.a. PCI passthrough, AMD-Vi and Intel VT-d), you can assign assign I/O devices (e.g., the graphics card) to VMs.

On the current versions of Ubuntu, you can use Xen, as long as both your motherboard and your CPU support IOMMU.

I’m currently using a Windows 7 VM with two AMD 7950 GPUs, and it works very well for gaming and Bitcoin/Litecoin mining.

  • Detailed guide about Xen VGA pass-through
  • Full tutorial for building a gaming VM (uses Fedora, not Ubuntu)
  • Installing Xen on Ubuntu
  • Success story on Super User
  • Xen VGA Passthrough Tested Adapters
Читайте также:  Настройка ftp сервера линукс

Note that you can use the GPU on in that VM is you pass it through.

Your windows VM mostly runs on emulated hardware. That hardware is usually relative simple.

  1. It is possible to emulate 3D functions. Performance is usually sub par, and sometimes it does not work as expected. (E.g. running Baldur’s Gate 1 with 3D acceleration enabled in Vmware workstation 8 crashes my whole host. Not just the VM). This will improve over time for all VMs.
    In fact, vmware workstation 9 claims significant improvements, but I have not tested that version yet. I know 5.5 and 8 did not suffice.
  2. Instead of emulating you can directly access hardware from a VM. The keyword is is PCI[e] passthough. This is a feature usually used to pass though special cards, 10 Gbit NICs etc, but it should also work for graphics cards.. Note that will use a card only for the VM. With graphics cards this means using a second graphics card for the VM.

Have you tried Virtual Box ? By reading feature list it looks like that it has what you need . access to GPU and CPU.

Windows Gaming on Linux: Single GPU Passthrough Guide, I show my single GPU passthrough setup which lets you run popular Windows games and software under Linux by passing the GPU to a full performance Windows …

Источник

Как на linux запустить тяжелую игру через виртуальную машину с OS Windows 10?

Столкнулся с тем что в виртуальной машине windows 10 видеокарта стоит «VirtualBox Graphics Adapter (WDDM)», из-за этого, полагаю, у меня не запускается игра. При запуске игры пишет что видеокарта не поддерживается.

Объясните как сделать так, чтобы все запускалось?

Простой 7 комментариев

kshnkvn

Зачем вообще ставить линукс, что-бы потом через костыли пытаться вернуть эспириенс с виндовс? Если он нужен для работы, почему нельзя в виндовс использовать wsl/vbox/vagrant/docker да что угодно?

Ivan Yakushenko, Программирую и сижу на linux, так удобнее, только вот игру тестировать нужно на windows, постоянно после правок перепрыгивать с linux на windows и обратно время много уходит, плюс сервер нужен постоянный так как на локалке уже не запустишь.

ramanovsky, Программируете эту же игру?
1.Самый простой вариант переходить на винду полностью.
2.Второй комп с виндой
3.Вторую видеокарту в комп, ее пробрасываете в вируталку (т.е. хостовавя система не будет ее использовать совсем). Там уже ставите родные драйвера на видюху и т.п. Потребуется отдельный монитор, подключенный ко второй видюхе, чтоб виртуалка начала на него что-то выводить. Проброс видео могут поддерживать не все гипервизоры. В свое время читал, что KVM это умеет.

res2001, да, пишу скрипты для него.
1. На винде нет определенного софта для программирования игры.
2. Дорогой вариант, но если другие не сработают, придется.
3. Можно попробовать.

Adamos

ramanovsky, у второго варианта есть инвариант: на этом компьютере таки поднять винду (возможно, дуалбутом), а под линь взять второй поплоше, вам вряд ли в нем требуется что-то тяжелое для ковыряния скриптов. Монитор можно один через KVM.
Есть еще четвертый вариант, на самом деле — Десяточка с ее Линукс-прослойкой. Но сам не пробовал, не собираюсь и поэтому советовать не буду.

15432

ramanovsky, ну если на ПК встроенная и дискретная есть, то можно дискретную пробросить, а со встройки сидеть

15432, для этого хотел купить специально вторую видеокарту. Но идею забросил. Так как я понял на виртуалке все равно производительность низкая. Люди писали что у них фпс 1-2 было.

Источник

Оцените статью
Adblock
detector