Can't make new wineprefix on external hard drive

Questions about Wine on Linux
Post Reply
joshop
Newbie
Newbie
Posts: 4
Joined: Wed Jun 03, 2020 10:59 am

Can't make new wineprefix on external hard drive

Post by joshop » Tue May 04, 2021 10:59 pm

Hello,
I've been trying to run a wineprefix off of an external hard drive (mounted to /media/...), but when I attempt to create it with:

Code: Select all

WINEPREFIX=/path/to/drive/newprefix wine winecfg
I get a huge amount of errors, starting with:

Code: Select all

0009:err:file:init_redirects cannot open L"C:\\windows" (c000000f)
0009:err:process:init_windows_dirs directory L"C:\\windows" could not be created, error 2
0009:err:process:init_windows_dirs directory L"C:\\windows\\system32" could not be created, error 3
0009:err:process:init_windows_dirs directory L"C:\\windows\\syswow64" could not be created, error 3
000b:err:process:init_windows_dirs directory L"C:\\windows" could not be created, error 2
000b:err:process:init_windows_dirs directory L"C:\\windows\\system32" could not be created, error 3
000b:err:process:init_windows_dirs directory L"C:\\windows\\syswow64" could not be created, error 3
000b:err:wineboot:main Cannot set the dir to L"C:\\windows" (2)
000d:err:process:init_windows_dirs directory L"C:\\windows" could not be created, error 2
000d:err:process:init_windows_dirs directory L"C:\\windows\\system32" could not be created, error 3
000d:err:process:init_windows_dirs directory L"C:\\windows\\syswow64" could not be created, error 3
0010:err:process:init_windows_dirs directory L"C:\\windows" could not be created, error 2
0010:err:process:init_windows_dirs directory L"C:\\windows\\system32" could not be created, error 3
0010:err:process:init_windows_dirs directory L"C:\\windows\\syswow64" could not be created, error 3
0010:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0010:err:winediag:nodrv_CreateWindow The explorer process failed to start.
0010:err:setupapi:SetupDefaultQueueCallbackW copy error 2 L"\\\\?\\unix\\usr\\share\\wine-development\\wine\\l_intl.nls" -> L"C:\\windows\\system32\\l_intl.nls"
0010:err:setupapi:SetupDefaultQueueCallbackW copy error 3 L"\\\\?\\unix\\usr\\share\\wine-development\\wine\\l_intl.nls" -> L"C:\\windows\\system32\\l_intl.nls"
and continuing on for quite a while, with many "failed to create file L"some file" (error=3)" messages. When I try the exact same process in my home directory, it works like a charm. What differs between these that causes the issue?

andrew.smart
Level 2
Level 2
Posts: 33
Joined: Thu Dec 15, 2016 3:08 am

Re: Can't make new wineprefix on external hard drive

Post by andrew.smart » Wed May 05, 2021 8:52 am

Make sure your user and/or group has write permissions for /path/to/drive/newprefix
Try making a file there manually as a test, e.g. `touch /path/to/drive/newprefix/foo`

Do you have a sandboxing program installed like firejail? After running `sudo firecfg` it often restricts applications, such as `wine`, to strictly your home directory. You'll need to change the sandboxing configuration to allow access to /media or wherever else. In the case of firejail I believe that would be:

Code: Select all

# ~/.config/firejail/wine.local
noblacklist /path/to/drive/newprefix

joshop
Newbie
Newbie
Posts: 4
Joined: Wed Jun 03, 2020 10:59 am

Re: Can't make new wineprefix on external hard drive

Post by joshop » Wed May 05, 2021 9:09 am

I can create that new file, and wine does indeed create a drive_c directory and a dosdevices directory - both of which are empty - and some .reg files in the new prefix. I don't believe I have any sandboxing programs installed (I can confirm specifically not firejail).

invisible kid
Level 3
Level 3
Posts: 83
Joined: Tue Dec 24, 2019 3:23 pm

Re: Can't make new wineprefix on external hard drive

Post by invisible kid » Wed May 05, 2021 11:23 am

Echoing the other poster, there is probably a permissions thing going on with the external drive.
as root if you do something like the following

Code: Select all

mount /dev/<dev name> /media/<mount name>
will usually mount it with root permissions
There are many ways to remedy this, the most common I use are
1. assign ownership to your regular user:

Code: Select all

chown <username>:<username> /media/<mount name>
2. quick and dirty: open it up to everyone(not terribly safe):

Code: Select all

chmod 777 /media/<mount name>
Just a couple examples for a starting point

joshop
Newbie
Newbie
Posts: 4
Joined: Wed Jun 03, 2020 10:59 am

Re: Can't make new wineprefix on external hard drive

Post by joshop » Wed May 05, 2021 12:55 pm

I can confirm that I own the drive, and even if I try chown, the same issue occurs. If I try the same thing with a directory I obviously don't own (i.e. /root), wine reports that I don't own it but doesn't issue any further errors.

invisible kid
Level 3
Level 3
Posts: 83
Joined: Tue Dec 24, 2019 3:23 pm

Re: Can't make new wineprefix on external hard drive

Post by invisible kid » Wed May 05, 2021 10:36 pm

Sorry, I completely missed your post immediately before my last post.

joshop
Newbie
Newbie
Posts: 4
Joined: Wed Jun 03, 2020 10:59 am

Re: Can't make new wineprefix on external hard drive

Post by joshop » Thu May 06, 2021 9:17 am

Just noticed that it's likely a problem with the filesystem, if I format a different storage medium (which had failed in this way before) to ext4, it succeeds, and the original drive was formatted to vfat.

SetantaLP
Level 3
Level 3
Posts: 53
Joined: Mon Jul 31, 2017 3:55 am

Re: Can't make new wineprefix on external hard drive

Post by SetantaLP » Fri May 07, 2021 3:45 am

As fas as I know it's strongly recommended to only make wine prefixes on partitions formated with a native filesystem of the OS (which means ext4 or similar in case of Linux and HFS+ or APFS in case of macOS) because native windows filesystems are often mounted in a way, which prevents files from being created if they contain characters that are not allowed on windows (like in this case ":" which windows uses for drive letters), to prevent issues (like inaccessible data) if the drive is used under windows.

Post Reply