Can we use "Winecfg" to completely make ./wine on external drive while WineHQ already installed on internal drive ?

Questions about Wine on Linux
Locked
Nokia-808
Level 2
Level 2
Posts: 22
Joined: Wed Apr 20, 2016 11:50 am

Can we use "Winecfg" to completely make ./wine on external drive while WineHQ already installed on internal drive ?

Post by Nokia-808 »

Hi all.

The case is as following:
1) my laptop has single internal drive (HDD) that my OS (Linux Fedora) already installed on it since about 5 years,
2) I bought new SSD of 2 TB size, & I'm connecting it to my laptop by using external enclosure through USB version 3.0 SATA-to-USBversion3.0 cable of enclosure to my laptop's built-in USB version 3.0 port,
3) the home directory of user account within which I'm using WineHQ was already created within default internal HDD.

I like to make ./wine & all prefixed within it be by default on the new SSD (that connected externally) & no any of them run within internal HDD. Can I do this through "Winecfg" ? And if not, then is there other way to do this ? I do not like to install Windows games within default internal HDD, because they takes too much size from internal HDD .......

I'm already read your Wiki but did not find enough details about this - see:
https://wiki.winehq.org/Winecfg#Drives

Can you give me, kindly, exact step to do that if it is possible ?
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can we use "Winecfg" to completely make ./wine on external drive while WineHQ already installed on internal drive ?

Post by Bob Wya »

@Nokia-808

You would probably want to move your internal, default WINEPREFIX to your external drive.
winecfg is not involved in this process at all.

E.g. with your external mounted at:

Code: Select all

/mnt/external_ssd

Code: Select all

sudo rsync -achv --progress ~/.wine/ /mnt/external_ssd/.wine/
Then to access the duplicated WINEPREFIX on the external drive use:

Code: Select all

WINEPREFIX="/mnt/external_ssd/.wine/" wine ???.exe
or

Code: Select all

export WINEPREFIX="/mnt/external_ssd/.wine/"
wine ???.exe
Obviously you would change these paths, to whatever your requirements are.

See: WineHQ FAQ: 6.5 Wineprefixes.

Bob
Nokia-808
Level 2
Level 2
Posts: 22
Joined: Wed Apr 20, 2016 11:50 am

Re: Can we use "Winecfg" to completely make ./wine on external drive while WineHQ already installed on internal drive ?

Post by Nokia-808 »

@Bob Wya
Thank you for replay.

But no ! My aim is not moving the current ./wine from default internal HDD to the new external SSD.

My aim is starting from scratch. To be more clear I will re-write my question as following: "does, currently, WineHQ has built-in option by which can I set the default location of /.wine & change it from internal drive to external drive" ? This is my question.

From the FAQ link that you offered in your kind replay, I conclusions. Kindly, just review these conclusions & see if they are right or wrong &, kindly, correct me if any of them is (are) wrong:
1) there is no need to set location of /.wine to other drive (like my external SSD),
2) it is only needed to create new prefix (a new /.wine like /.wine2 if on same disk or /path-to/new-disk/.wine in my case).
So, in my case it will be as following:

Code: Select all

export WINEPREFIX=/dev/sdb/.wine
wine winecfg
3) if I will applied what I described in point (2) above, then the original ./wine (prefix on internal HDD) will be used merely as a directory where configurations of WineHQ are installed, but virtual drive c: where Windows applications & games will be installed will be within ./wine that located within new SSD. Right this ?
4) if I applied what I described in point (2), then if I delete ./wine that located on internal HDD (where Wine configurations are stored) then I will not able to use ./wine that created within new SSD & to re-use it again I need to repeat steps in point (2) above. Right ?

If my conclusions are correct then issue is solved.

Only one further help I need. On my system I'm already has 2 user accounts, 1st one is the 1st user account that created during fresh installation of my OS (Fedora Linux). This account can use "su/sudo/polkit" powers. The 2nd user account I create it specifically for WineHQ. This 2nd user account is special because I configured it to be has no any root power (it can not use su or sudo or polkit), a super secure account. WineHQ owner ship was changed so that WineHQ binary is only associated with 2nd rootless user account. My new SSD I'm using it externally via external enclosure connected by cable to my laptop built-in USB version 3.0 port. This new SSD making like a USB stick. It is mounted on home directory of user account that I login to. If I login to my 2nd user account it will be mounted at:
run/media/wineuser/external_ssd_name (/dev/sdb) as appeared by my system file manager & GNOME Disks GUI. I'm in this case - after login to "wineuser" - is at /windows
So, what I'm confusing now, since I'm not so expert, is that what I have to run:

Code: Select all

export WINEPREFIX=/dev/sdb/.wine
or

Code: Select all

export WINEPREFIX=/run/media/wineuser/external_ssd_name/.wine
Thank you very much for your kind help!
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can we use "Winecfg" to completely make ./wine on external drive while WineHQ already installed on internal drive ?

Post by Bob Wya »

  1. Each WINEPREFIX, including the default WINEPREFIX:

    Code: Select all

    "${HOME}/.wine"
    is like an independent installation of Windows, with it's own (self-contained) C:\ drive.
  2. To set up a new WINEPREFIX on your external media drive:

    Code: Select all

    export WINEPREFIX=/run/media/wineuser/external_ssd_name/.wine
    wineboot -u
  3. As long as WINEPREFIX variable is exported, in the current shell environmen ( as per 2. ) ...
    Then Wine will access the WINEPREFIX on the external drive.
    The default WINEPREFIX will (effectively) be completely independent from this new, external WINEPREFIX ...
  4. No the default WINEPREFIX can be deleted, and you can choose not to use it all after this.
    This will make no difference to the new WINEPREFIX you have created on your external drive.
  5. WINEPREFIX should point at a filesystem mount-point - not a device path.
Hope that helps clear up your questions a bit! 8)

Bob
Nokia-808
Level 2
Level 2
Posts: 22
Joined: Wed Apr 20, 2016 11:50 am

Re: Can we use "Winecfg" to completely make ./wine on external drive while WineHQ already installed on internal drive ?

Post by Nokia-808 »

@Bob Wya
You clarified every thing ! I dictated your replay to be one of Linux references.

Only one thing, remain, I would like to be assured about: suppose that user by accident, without intention, launch WineHQ while external SSD is disconnected, then what it will happened ? I'm supposing just an error message without serious consequences, isn't it ?
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can we use "Winecfg" to completely make ./wine on external drive while WineHQ already installed on internal drive ?

Post by Bob Wya »

Nokia-808 wrote: Wed Feb 24, 2021 1:01 pm @Bob Wya
You clarified every thing ! I dictated your replay to be one of Linux references.

Only one thing, remain, I would like to be assured about: suppose that user by accident, without intention, launch WineHQ while external SSD is disconnected, then what it will happened ? I'm supposing just an error message without serious consequences, isn't it ?
@Nokia-808

If WINEPREFIX is set to path that doesn't exist and doesn't involve just creating the single root WINEPREFIX directory - then Wine will just fail with the error message:

Code: Select all

wine: chdir to xxxxx : No such file or directory
Which is obviously not a big deal! :lol:

Bob
Nokia-808
Level 2
Level 2
Posts: 22
Joined: Wed Apr 20, 2016 11:50 am

Re: Can we use "Winecfg" to completely make ./wine on external drive while WineHQ already installed on internal drive ?

Post by Nokia-808 »

Issue is solved.

Only the following sentence I can not grasp due to technical/language barriers:
".... and doesn't involve just creating the single root WINEPREFIX directory ...."
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Can we use "Winecfg" to completely make ./wine on external drive while WineHQ already installed on internal drive ?

Post by Bob Wya »

Nokia-808 wrote: Fri Feb 26, 2021 7:21 am Issue is solved.

Only the following sentence I can not grasp due to technical/language barriers:
".... and doesn't involve just creating the single root WINEPREFIX directory ...."
@Nokia-808

Sorry that wasn't really very clear! :lol:

I just meant that Wine will create the final directory of WINEPREFIX path and setup a clean WINEPREFIX - if it doesn't exist.

Code: Select all

export WINEPREFIX=/run/media/wineuser/external_ssd_name/.wine
wineboot -u
will work if the path:

Code: Select all

/run/media/wineuser/external_ssd_name
already exists. If not Wine will fail.

So if your external USB drive is not mounted - then Wine will fail with the No such file or directory error.

Hope that's a bit clearer! :D
Bob
Locked