[Voltagex] was fed up with BSODs on his Windows machine due to a buggy PL2303 USB/serial device driver. The Linux PL2303 driver worked just fine, though. A weakling would simply reboot into Linux. Instead, [Voltagex] went for the obvious workaround: create a tiny Linux distro in a virtual machine, route the USB device over to the VM where the drivers work, and then Netcat the result back to Windows.
OK, not really obvious, but a cool hack. Using Buildroot, a Linux system cross-compilation tool, he got the size of the VM down to a 32Mb memory footprint which runs comfortably on even a small laptop. And everything you need to replicate the VM is posted up on Github.
Is this a ridiculous workaround? Yes indeed. But when you’ve got a string of tools like that, or you just want an excuse to learn them, why not? And who can pass up a novel use for Netcat?
Awesome trick!
I’ve been using netcat for years on old SCO systems so they can print to networked laser printers. It’s kind of a swiss army knife of useful networking utilities.
Cool trick! But wouldn’t it be easier to write driver from the Linux driver source using libusb-win32 instead?
I’d love to have the skills to do that – do you have any ‘beginner’ resources?
http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/ is a good beginner’s tutorial on LibUSB (C++ API, but many bindings exist for other languages)
http://lxr.free-electrons.com/source/drivers/usb/serial/pl2303.c is the LXR page for the Linux PL2303 driver
and https://github.com/tonyrog/libusb/blob/master/src/pl2303.erl is the source of a LibUSB PL2303 driver that apparently already exists…
Umm yeah that is the first time ever that drivers were better in Linux.
My machines at home and work are all Linux…. just saying.
Same, and not a single driver needed to be installed.
But in this case it’s probably the whole “clone” PL2303 thing, the official Prolific drivers can detect clone chips and the drivers refuse to initialise them.
No it’s not about “fake” chips. The PL2303 driver sucks AAAAAAAAAAASS. It causes BSODs from time to time with me too, on W7. One way to cause BSOD is for example having arduino serial monitor monitoring traffic from an arduino board (that actually sends data) and closing the serial monitor, then trying to monitor with another serial monitor program, that does not have the same settings like instead of speed being 9600, the second monitor program has 19200 or any other setting is different. BSOMFD. Atleast for me, that’s a BSOD every time.
Well that does indeed suck, I’ll stick to my Fedora PC then… I have KVM/Qemu running on my Debian server with a Windows VM for the odd occasion I need Windows which is becoming less and less these days.
I have a new box with only Linux Mint and I’ve been having a great time so far.
I installed Mint on my new PC in December (dual-boot), over half the time it drops USB (keyboard, mouse) during boot, and sound system is not-working.
Same experience for me….
Or you can buy a FTDI cable which has stable Windows drivers for $10, but then it wouldn’t be a hack.
Up until you plug it into a laptop which has the crippled ftdi drivers which go and brick your ftdi adapter… Since for $10 you definitely did not get an authentic chip
And that’s why you buy from a chinese vendor a USB->Serial cable using the CH340 chipset.
They just work, and no bull on Windows, Mac, or Linux.
Do you still have to disable system wide security settings to get the CH340 working in OSX? That was a big barrier to entry for me on those.
Fortunately, I avoid Mac as much as I can. I just know that it does work, and work well on Macs.
I’m strictly a Linux dev.
No but for $1.50 I did, or at least I got something that worked and still works
Update your FTDI drivers – they don’t do this anymore. A genuine FTDI cable can also be had for less than $20 shipped to the States.
I use this, a bit pricey but it’s based on an ATMega 32U2 instead of a PL or FTDI chip, it just works in Linux and Mac, requires an INF file be installed in Windows, and a nice bonus is they included an ICSP header so it can be reprogrammed or even reused as an ATMega 32U2 dev board.
Other nice bits are the 3.3/5v switch, and extra pin headers incase you decide to reprogram it for other jobs.
http://www.freetronics.com.au/products/usb-serial-adapter
Yes, they are 10x the price of eBay clones but it’s a solid little device that can be upgraded and hacked.
i’m really glad to see so many references to Linux on this forum.
Interesting… I had a similar problem with Windows and ended up using an dual ARM board as the bridge. I thought the drivers need to be functional on Windows before Virtual Box would “latch” onto it?
Not really. I have fake ftdi chip whose “version” isn’t supported on Windows 8, but worked just fine on a VM windows xp
Dude, you are not me.
In this day and age, it may not even be a “dude”. B^)
You do have a point. Let me refrase that: Dude or dudette, you are not me.
Creative non the less but couldn’t he just find a different version of the PL230x drivers? For my Baofeng programing cables (that probably use knockoff chips they were so cheap) they have archives of the 3.2.0.0 driver. Never had a problem with it over the newer 3.6.x drivers. For me first step would be researching the problem, rolling back drivers, then thinking about rolling a linux-vm-netcat solution.
Hmmm. My hammer seems to be broken. I wonder if I have an older hammer laying ’round. Wait I got it. Here is a chunk of metal and a monkey wrench. That will work.
I’m travelling and without my full set of bits and pieces. The PL2303 chip is soldered to another cable here and I’m not in a position to replace it. The older Windows drivers caused instability for me.
You can only go so far back on “restrictive” Windows 8 or higher. It’s a damn pain in the ass if the drivers aren’t signed to Windows satisfaction.
Microsoft is clenching their asses so tight even many of the hardware using Microsofts “stock” drivers need to be signed.
I have to agree. I’ve used a PL2303 based cable for years on many different computers and never had a problem with it. The only thing that would make sense is that I’ve been using the same driver on all of them, saved to a USB stick I carry with me all the time. I primarily use it to connect to switch and firewall console ports.
Socat is even better. It can create “real” serial devices.
http://lb9mg.no/2015/07/09/serial-port-redirection-from-windows-to-linux-with-socat/
Thank you for this. I wonder if it’ll compile with musl or uclibc though?
I thought about doing this the other night, but my internet is slow so it was faster to go grab my old win7 box where pl2303 drivers actually work.
Next time, skip Windows altogether ! Linux is a real nice/superior OS as a Desktop since a year or 6.
LybreOffice compatibility, GPU drivers, and some hardware can still be a pain… I still do a google search for driver support problems prior to purchasing a laptop or printer.
However, a customized Linux Mint install has just about everything I wanted for workstations.
The adware free version of Windows (no we won’t upgrade to Windows 10-foot-poll edition even for free) run Solidworks for the resident engineer/complainer. Linux is for power users… MacOS is for consumers… and Windows OS is making Microsoft redundant.
What about getting rid of Windows anyway? You won’t regret it.
I hope to upgrade(?) my wife’s laptop from Win8.shit to Win10, I heard 10 is free for people who bought machines with 8 on them.
why netcat when virtualbox can also have a serial port that is presented to the host?
I looked at this too. PuTTY needs to be run as admin to talk to a COM port in Windows.
I believe that Prolific detects that the chip is counterfeit (99.9% of the cables and adapters with pl2303 are fake – even more than the FTDI chips) and BSODs the machine. These problems with their more recent drivers are well known.
Profilic does have a program, that tells you if it’s fake or not. Mine says it’s qenuine, still BSODs when certain things are done. The driver simply sucks.
They must be doing a very poor job detecting fake chips. Only 1 out of 8 fake chips so far I have works great with the latest Windows drivers. The fact that they requires external crystal and they were $0.10 a piece (I bought them a few years back) are signs that they are fake chips.
I think I’m going to stick with http://www.seeedstudio.com/depot/CH340G-USB-to-Serial-TTL-ModuleAdapter-p-2359.html next time
Never had any bsods with fake pl2303 and ftdi, you have to check drivers versions, latest ftdi drivers killed fake ftdi chip (some bytes where written in the eprom, they were recoverables), i think it was the same for pl2303 …
I use ch340 based adapters, and genuine ftdi chips, no probs in windows up to 10 32 or 64 bits
Good hack but way to complicated for me.
I wonder if you could make the VM even smaller by using OSv. OSv is a unikernel implementation that allows you to basically have a VM with kernel + software to run, and very little else, and can work with standard POSIX software.
These are hardware drivers that the manufacturers write and maintain on their own, and their closed-source nature means most Linux distributions won t bundle and automatically enable them for you.
unrelated but,
a long time ago i i ran xboxhdm in a vm on xp with direct access to ide 1 and did the hotswap trick to hack an original xbox while reading the step by step online all on the same physical machine without powering down, i got lucky i didnt ground the two together i think xbox was floating ground and pc earth ground? at the time no one else had tried it