Kernel module cannot be loaded on Windows due to Unicode

Discussions related to using the OSE version of VirtualBox.

Kernel module cannot be loaded on Windows due to Unicode

Postby Kentzo » 22. Jul 2015, 21:23

VirtualBox does not support loading from paths that contain Unicode symbols. It's impossible to even use wide char on Windows, since vritualboxes uses A version of API.
Moreover, short paths does not work either.

Is there a workaround, e.g. encoding we can use to to transform Path into A-acceptable version VirtualBox will be able to understand later?
Kentzo
 
Posts: 4
Joined: 22. Jul 2015, 21:21

Re: Kernel module cannot be loaded on Windows due to Unicode

Postby noteirak » 23. Jul 2015, 11:04

Could you provide a sample code to reproduce the issue please? Including the creation of the folder with the unicode name.
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

Re: Kernel module cannot be loaded on Windows due to Unicode

Postby mpack » 23. Jul 2015, 11:06

I'd like to see justification of "short paths don't work either". I don't see how they can fail, and I'm pretty sure I've seen VBox error messages using them (which implies that they're being passed around internally on Windows hosts).
mpack
Site Moderator
 
Posts: 29971
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Kernel module cannot be loaded on Windows due to Unicode

Postby Kentzo » 23. Jul 2015, 11:48

It's a little hard to provide source code, but we are using the setExtraData method to set string like "C:\غازي\MyKernelModule.dll". We use Python bindings, but AFAIK VirtualBox only uses A version of API which cannot represent such string by definition.

We tried to mitigate that by converting paths into short paths (even if they do not contain unicode symbols, to avoid unnecessary checks). But VirtualBox failed with the Unable to load R3 module GetLastError==126 error (VERR_MODULE_NOT_FOUND). Example of such path would be "C:\PROGRA~1\Andy\LIBAND~2.DLL"

Just recovered another strange thing from our discussion: the following path "D:\طفجدفسفم\lib64" was written as "D:\طفجدفسفم\lib64" into vbox file of VM.
Kentzo
 
Posts: 4
Joined: 22. Jul 2015, 21:21

Re: Kernel module cannot be loaded on Windows due to Unicode

Postby mpack » 23. Jul 2015, 12:27

Why is that strange? An ASCII xml file will use xml escape encodings.
mpack
Site Moderator
 
Posts: 29971
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Kernel module cannot be loaded on Windows due to Unicode

Postby Kentzo » 23. Jul 2015, 23:46

Ok, that does mean that string was properly saved into XML file, that's good to know.

It worths to note that my module should support 4.3.12 and onwards.

VirtualBox uses the LoadLibraryA function to load modules till VirtualBox 5. That means that there is no way paths such those I posted will work.

Now, I'm trying to figure out why cannot it load it by short path. It could be a code signing issue… We're further debugging it and I will let you know as soon as I will have results.
Kentzo
 
Posts: 4
Joined: 22. Jul 2015, 21:21

Re: Kernel module cannot be loaded on Windows due to Unicode

Postby Kentzo » 24. Jul 2015, 01:03

It appears that VirtualBox 4.3.12 rejects my kernel module because of the signature created using Verisign certificate (signtool says it's OK).
In other hand it loads the same module signed with COMODO certificate (signtool says it's OK as well).

However the error is VERR_MODULE_NOT_FOUND which is greatly misleading.
Kentzo
 
Posts: 4
Joined: 22. Jul 2015, 21:21

Re: Kernel module cannot be loaded on Windows due to Unicode

Postby noteirak » 28. Jul 2015, 11:53

Yes, signature restriction were already in effect at this point I believe. There are several discussions about this restrictions in VirtualBox OSE Forum.
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

Re: Kernel module cannot be loaded on Windows due to Unicode

Postby bird » 28. Jul 2015, 16:12

Which version of VirtualBox have you been using? I believe this problem was fixed late in the 5.0.0 test cycle.

Kind regards,
bird.
Knut St. Osmundsen
Oracle Corporation
bird
Oracle Corporation
 
Posts: 119
Joined: 10. May 2007, 10:27


Return to VirtualBox OSE

Who is online

Users browsing this forum: No registered users and 1 guest