Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Adding a printer to Windows under Qemu-KVM, major problems.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Dr Croubie
Apprentice
Apprentice


Joined: 21 Nov 2006
Posts: 159

PostPosted: Mon Apr 08, 2013 9:36 pm    Post subject: Adding a printer to Windows under Qemu-KVM, major problems. Reply with quote

Hi guys, I'm having a problem to which I'm sure there's an answer, but i've just not used Qemu much before so i'm just looking for the right commands.
Firstly, I've got an AMD Phenom x6 with full VT support, and a Gigabyte GA-990FXA-UD3 with IOMMU and all that.
I've compiled my kernel with full KVM support, created an image, installed Vista (yes, that made me shudder too, but I've got a license for it that I got with a laptop, so at least nothing's illegal), and it works fine, I can browse the internet and do whatever else you can do on windows.

Now, the one and only reason that I've done all that is because I just bought a very nice photo printer (Epson R3000) that I need to use under windows, for the installation, settings, driver etc, but mostly for the ICC profiles of the paper. Running this printer with all its features under linux is not an option as far as I can see, i'd rather virtualise.
There's two ways of hooking it up, ethernet and usb, and I only need one to work, but neither do. So here's my options:

1 - Network:
My desktop gentoo is run on dhcp (which I should change to static but i'm lazy) as 192.168.8.32.
It gets that from my router/dsl/modem, which is 192.168.8.1.
The printer also has dhcp, and is 192.168.8.34, I can ping it from within gentoo and see it on the modem as a client.
When I load windows, however, windows' IP address is 10.0.something and it can't find the printer.
How do I configure Qemu and load windows so that it appears as another unique device to my router? Or at least, how can I make it still on the same 192.168.8.* subnet so that it can directly access my printer?
my current command-line loader is this:
qemu-system-x86_64 -m 1024 -hda Vista.img -boot c -cdrom /dev/cdrom -usb -net nic -net user
I've added in the "-net nic -net user" as I read it somewhere after googling, it doesn't help with or without it.
I'm sure I'm just missing out a command about bridging or something in there, but I just can't figure out what.
(this motherboard only has a single ethernet port, my old one had two, it would have been a lot easier with 2 methinks)

2 - USB:
The alternative is to use its USB cable. when I load kvm with the "-usb" option and go into the qemu monitor, I get this:
http://croubie.smugmug.com/photos/i-CwZvHR3/0/XL/i-CwZvHR3-XL.gif
and when I try to add in the Printer's USB address to be visible to Windows, I get 'Permission Denied' Errors:
http://croubie.smugmug.com/photos/i-3DzsQX9/0/XL/i-3DzsQX9-XL.gif
and just for posterity:
> groups
tty wheel uucp audio cdrom video games kvm usb portage rjs <-anything missing there that would help? I'm in 'usb' and 'kvm', should I try running qemu from root maybe?


And option 3 and 4 are also possible, 3 is that I get a usb->ethernet adapter, figure out how to make that available to windows, and then run a network cable to the printer. Or 4, i've still got a laptop that I'm not using (which is where I got the Vista from), I could just dedicate that to being a print server.
But I'd rather do 1 or 2 if I can.
Thanks in advance for any help.

(edit, I hope those images work properly already)


Last edited by Dr Croubie on Wed Apr 10, 2013 9:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Mon Apr 08, 2013 9:58 pm    Post subject: Re: Adding a printer to Windows under Qemu-KVM, slight probl Reply with quote

Dr Croubie wrote:
but I've got a license for it that I got with a laptop, so at least nothing's illegal)


LOL sorry dude, you're a pirate
windows sold with a computer are OEM license, OEM license prevent installing the OS on other computer than the one the license was sold with.
Now it's easy to guess if your license is OEM or not, a laptop you said...

(and because i feel i cannot just slap your fingers without saying something about your problem)
http://wiki.qemu.org/Documentation/Networking
Quote:
Adding the following to the qemu command line will change the network configuration to use 192.168.76.0/24 instead of the default (10.0.2.0/24) and will start guest DHCP allocation from 9 (instead of 15):

-netdev user,id=mynet0,net=192.168.76.0/24,dhcpstart=192.168.76.9


I suppose this should do the trick, replace with proper needed IP
Back to top
View user's profile Send private message
Dr Croubie
Apprentice
Apprentice


Joined: 21 Nov 2006
Posts: 159

PostPosted: Tue Apr 09, 2013 11:13 am    Post subject: Reply with quote

Unfortunately, that ain't it either.
> qemu-system-x86_64 -m 1024 -hda Vista.img -boot c -cdrom /dev/cdrom -usb -netdev user,id=mynet0,net=192.168.8.0/24,dhcpstart=192.168.8.55
and then windows doesn't even recognise a network card at all.
That linked page had a good idea though, namely "However, if you are looking to run any kind of network service or have your guest participate in a network in any meaningful way, tap is usually the best choice. "
Unfortunately, the documentation sort of trails off a bit on the Tap side of things.

I tried it anyway and got this:
> qemu-system-x86_64 -m 1024 -hda Vista.img -boot c -cdrom /dev/cdrom -usb -netdev tap,id=something
qemu-system-x86_64: -netdev tap,id=something: could not configure /dev/net/tun: Operation not permitted
qemu-system-x86_64: -netdev tap,id=something: Device 'tap' could not be initialized

Trying it as root and I get:
> qemu-system-x86_64 -m 1024 -hda Vista.img -boot c -cdrom /dev/cdrom -usb -netdev tap,id=something
/etc/qemu-ifup: could not launch network script
qemu-system-x86_64: -netdev tap,id=something: Device 'tap' could not be initialized
which is probably related to me not having tun/tap in the kernel, or maybe I do, haven't checked.


Thinking of root, I thought about trying the usb-side of things run as root as well. Windows loads, I do the usb_add in the monitor window, and it shows up in windows, finally. I get a "this device can perform better if you plugged it into usb2" message (it is, but windows doesn't know it's usb2 for some reason). Still, I go to install the software and it still can't communicate. Maybe it's the speed, in that it needs usb2 and 1 is just too slow? or there's something else screwy going on in there...

any other ideas? (before I find my old laptop, put vista on that, and definitely won't be a criminal?)
Back to top
View user's profile Send private message
Dr Croubie
Apprentice
Apprentice


Joined: 21 Nov 2006
Posts: 159

PostPosted: Wed Apr 10, 2013 9:30 pm    Post subject: Reply with quote

Another update: this is getting weird. I borrowed a USB->Net adapter from work, and I can't get that to work either.

I'm now starting my system using this command:
qemu-system-x86_64 -m 1024 -hda Vista.img -boot c -cdrom /dev/cdrom -usb -device usb-host,hostbus=1,hostaddr=1 -device usb-host,hostbus=2,hostaddr=1 -device usb-host,hostbus=3,hostaddr=1 -device usb-host,hostbus=4,hostaddr=1 -device usb-host,hostbus=5,hostaddr=1 -device usb-host,hostbus=6,hostaddr=1 -device usb-host,hostbus=7,hostaddr=1 -device usb-host,hostbus=8,hostaddr=1 -device usb-host,hostbus=9,hostaddr=1 -device usb-host,hostbus=2,hostaddr=99 -device usb-host,hostbus=2,hostaddr=100 -device usb-host,hostbus=2,hostaddr=103 -device usb-host,hostbus=10,hostaddr=1 -device usb-host,hostbus=11,hostaddr=1
all of those "-device" lines are just to make sure that vista sees all of my USB hubs, and that there's nothing missing.
Anyway, so once it's booted, I plug in the adapter, a DLink DUT-E100:
> lsusb
Bus 002 Device 104: ID 2001:3c05 D-Link Corp. DUB-E100 Fast Ethernet [asix]
in the monitor, i do a:
> usb_add host:2001:3c05
go back to windows and it recognises that it's been plugged in.
Do the usual search for software, install the driver, now I get a
"windows found driver software but encountered an error
This device cannot start (Code 10)"

sigh, there's a pcoltergeist definitely trying to stop me from ever installing this printer...
Back to top
View user's profile Send private message
madchaz
l33t
l33t


Joined: 01 Jul 2003
Posts: 993
Location: Quebec, Canada

PostPosted: Tue Apr 16, 2013 5:44 pm    Post subject: Reply with quote

Hey, have a look here.

https://forums.gentoo.org/viewtopic-t-933610-highlight-.html

I have the impretion of creating an infinite loop here ...

The end result for me back then was "kvm is awesome but it's usb support is ... " yea, I'll stop there.
_________________
Someone asked me once if I suffered from mental illness. I told him I enjoyed every second of it.
www.madchaz.com A small candle of a website. As my lab specs on it.
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Sun May 05, 2013 1:34 pm    Post subject: Reply with quote

Code:
-usb -device usb-host,hostbus=1,hostaddr=1 -device usb-host,hostbus=2,hostaddr=1 -device usb-host,hostbus=3,hostaddr=1 -device usb-host,hostbus=4,hostaddr=1 -device usb-host,hostbus=5,hostaddr=1 -device usb-host,hostbus=6,hostaddr=1 -device usb-host,hostbus=7,hostaddr=1 -device usb-host,hostbus=8,hostaddr=1 -device usb-host,hostbus=9,hostaddr=1 -device usb-host,hostbus=2,hostaddr=99 -device usb-host,hostbus=2,hostaddr=100 -device usb-host,hostbus=2,hostaddr=103 -device usb-host,hostbus=10,hostaddr=1 -device usb-host,hostbus=11,hostaddr=1


^^^ that's not how computers work. You pick your device from lsusb, then you pass it to qemu.

Code:
-usbdevice host:2001:3c05


Should get the job done. You could do it even with the printer.

Make sure your qemu is the latest 1.4.0, some older versions had borked usb emulation.

Another there's a difference with assigning a usb and using IOMMU passthrough. IOMMU is more exclusive or something.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum