LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 08-24-2014, 11:04 PM   #1
Abscissa256
Member
 
Registered: Aug 2011
Posts: 79

Rep: Reputation: Disabled
Give a Win guest VM VT-d access to the sole graphics card?


I'm pretty much a complete novice to VT-d (I've often run VirtualBox on a Windows host, and tried VMware on a Win host once or twice a while back, but that's the extent of my virtualization experience. Never touched VT-d). So I wanted to see if something like the following was feasible or even theoretically possible at all:

Assuming a computer that supports VT-d (not *just* VT-x) in the CPU, motherboard and BIOS: Suppose this computer has just one video card (integrated, although with multi-monitor support...but I'm guessing the multi-monitor part wouldn't make any difference), and you wanted to run Linux as the host OS, but [either permanently or temporarily, either way] give a virtualized Windows guest VT-d-based access to the (3d accelerated) graphics card.

Would that be:

- Entirely doable?
- Theoretically possible, but tricky or uncharted territory?
- Some major reason it cannot be done without an additional GFX card?

Or: What if the linux host was set up to (optionally?) work as headless, and the windows guest (with VT-d access to the GFX card) could simply ssh and/or vnc back into the linux host when necessary? Would that be any more feasible?
 
Old 08-25-2014, 08:43 AM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Theoretically if you had a headless Linux install you could allow a guest to use a graphics card but I've not seen evidence that anyone has done it and certainly not in VirtualBox. I've often toyed with the idea of having two graphic cards and giving one to a Windows guest but last time I tried it (which admittedly was a few years ago) I couldn't get it to work.
 
1 members found this post helpful.
Old 08-25-2014, 02:42 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Not sure there is a great reason for this. Most folks might just run windows OS as host and run vm on linux. Or they may just make a windowless client.
I guess it should be possible but I've never tried it.


The point of vt-d is to more integrate hardware with a vm. That does assume that you have some of the most advanced boards and most current software.
 
1 members found this post helpful.
Old 08-25-2014, 03:37 PM   #4
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Don't see any reason why you couldn't do that, but it'd be tricky to setup, though I guess you could ssh into the host with another computer after binding the graphics card to the guest. I would use KVM for that and follow one of the several threads out there. This one

https://bbs.archlinux.org/viewtopic.php?id=162768

is quite thorough, although no one is doing a headless version as far as I know.
 
1 members found this post helpful.
Old 08-25-2014, 04:11 PM   #5
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
I've played around with xen, but my hardware doesn't support vga passthough

My laptop has 'better; xen support using open source ati drivers..
Since only one gpu I've not put much effort into vga passthrough, but xen vms work (hvm pvm), and the dom0 is useable 'as normal'
Although other constraints (memory) limit the experience, one ,, maybe 3 small vms

My desktop 'fails', basically the nvidia gt620 'bombs out' regardless of driver
Xen vms work, but I have no 'local' access, only over network
Still it is good as headless system where I can run multiple servers

Last edited by Firerat; 08-25-2014 at 04:14 PM.
 
1 members found this post helpful.
Old 08-25-2014, 08:49 PM   #6
Abscissa256
Member
 
Registered: Aug 2011
Posts: 79

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
Not sure there is a great reason for this. Most folks might just run windows OS as host and run vm on linux.
Perhaps, but (speaking purely for my own self here) I've had my fill of Windows as the main host.

To be clear (and I realize this sorta contradicts what I said earlier), I wouldn't always be running things this way, just for things like Unity3D, or the occasional videogame, etc.

I just thought it might be an interesting "escape hatch" option when/if the usual solutions fail:

- Running 3D accel inside a VM *without* using VT-d (or AMD equivalent) has notable limitations, AIUI.

- I've heard good things about running games and such under Wine, which sounds awesome. But of course there's no guarantee I won't run into anything less Wine-friendly.

So I figured this could be a nice "middle ground" solution between those options versus having to completely shut down the entire Linux system to dual-boot into Windows. At least, in theory.

BTW, (warning: novice question ahead, I'm still learning about VT-d) it's my understanding that VT-d does *not* provide any way for the guest and host to share access to a hardware device (other than just simply not using VT-d). VT-d is apparently *just* for assigning a device *exclusively* to a single specific VM guest (and, as the main benefit, allow the VM to access it directly instead of through the host acting as a proxy). Is this all correct?
 
Old 08-26-2014, 06:16 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by Abscissa256 View Post
BTW, (warning: novice question ahead, I'm still learning about VT-d) it's my understanding that VT-d does *not* provide any way for the guest and host to share access to a hardware device (other than just simply not using VT-d). VT-d is apparently *just* for assigning a device *exclusively* to a single specific VM guest (and, as the main benefit, allow the VM to access it directly instead of through the host acting as a proxy). Is this all correct?
Yes, this is correct and the reason why you need a separate videocard for the VM, at least for now, this may change in the future.
From my experience: I am a gamer and I have tried to go Windows-less, but it isn't worth the hassle. I have tried gaming in a VM, which works for some older games, but this is rather the exception. Not all of my games work with Wine sufficiently, so this is out of question either. In the end I just reinstalled Windows in a dual-boot setup, but I reboot into Windows only rarely since most of my favorite games got a Linux edition (thanks to 2K Games for porting Civilization V and XCOM, thanks to Valve for porting all their stuff, thanks to the many independent developers that release for Linux also).
 
1 members found this post helpful.
Old 08-27-2014, 02:57 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
As VM technology advances, more and more hardware is being made available to the vm client directly. Currently one can attach a few components directly or indirectly to a client. The cpu is exposed directly and usb can be exposed. Adding in support for pci cards is next part of this progress.
 
Old 08-28-2014, 06:37 PM   #9
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
It was something like this I started with:
https://www.virtualbox.org/manual/ch...pcipassthrough
I was trying to use my (I think) NVIDIA 7300 GTX for the guest and my 9800 GTX for the host but I couldn't get a handle on exactly how to see the guest before and during configuration. I did only play for less than an hour but, as I mentioned, I haven't seen any indication anyone has got PCI passthrough for a graphics card working.
 
Old 08-29-2014, 02:22 AM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Hope this helps
https://www.virtualbox.org/manual/ch...pcipassthrough
Quote:
The first column is a PCI address (in format bus:device.function). This address could be used to identify the device for further operations. For example, to attach a PCI network controller on the system listed above to the second PCI bus in the guest, as device 5, function 0, use the following command:

VBoxManage modifyvm "VM name" --pciattach 02:00.0@01:05.0

To detach same device, use

VBoxManage modifyvm "VM name" --pcidetach 02:00.0
Oops same posting as 273

Last edited by EDDY1; 08-29-2014 at 02:28 AM.
 
Old 08-30-2014, 06:24 AM   #11
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Some have done it succesfully... on kvm/qemu at least:

https://bbs.archlinux.org/viewtopic.php?id=162768

I too played around with it (my mobo has IOMMU support it seems, required for kvm/qemu to pass devices), but couldnt get it work (2 cards an old nvidia nvs 285 and an ati x1200, same result). Maybe because i used fglrx (it is said that it hogs the pci bus and prevents certain stuff from working, radeon is recommended) or some config problem. I was able to see the card in the VM and even install drivers for it but "Device couldnt start" after reboot.
Other devices like a pci network card worked though.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXC: 10.04 guest can access VT's but 12.04 guest cannot? charlie101 Linux - Virtualization and Cloud 0 02-04-2013 01:51 AM
Red Hat - installing graphics card - w/ no admin access :( tarkesh Linux - Hardware 1 06-11-2009 11:13 AM
Dual monitors: inbuilt graphics card & external graphics card fanofai Linux - Newbie 1 06-07-2009 07:31 AM
Geforce 8400 graphics card issue | can't access tty ?? misstajah Linux - Laptop and Netbook 31 07-19-2007 06:35 AM
how to give 'guest' rwx permission on a file/directory RH9Linux Linux - Software 3 06-27-2005 08:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 05:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration