Score:2

How do you sandbox a Windows application to a specific Wine prefix like in Snaps?

gi flag

I have programs that require different Wine prefixes to work. To start them, I need to open up the terminal and specify which Wine prefix to use before launching. I would like to be able to have it where I can simply click on the application and have Wine automatically open up with that prefix. This is what happens when you install a Windows program off of Synaptic, so I would like to know how they do it.

Score:2
ar flag

There is a flatpak program called bottles.

It allows you to configure multiple instances of WINE with different versions and much more.

DealTime444 avatar
gi flag
I have Bottles but I've never had success with it. Does it let you just click on an icon and open an app, or do you have to open Bottles first?
Emre Talha avatar
ar flag
Left-click probably uses Wine without any settings, but when I right-click, there is an option "Open with Bottles". After that, it opens up a window to choose the preconfigured instance that I'd like to use.
DealTime444 avatar
gi flag
that may be slightly better than using the terminal but its not what i asked for. there is clearly a way to do it with left click, take for example the foobar2000 snap. you just download it from ubuntu software and it runs without any extra hassle
Score:2
ar flag

According to your comments on my previous answer, another option that I can recommend is creating your own .desktop files.

Every application on your applications menu has a .desktop file. This file determines the logo, title, execution parameters and right-click options. (and probably some other stuff that I'm unaware of)

[Desktop Entry]
Type=Application
Terminal=false
Exec=/path/to/executable
Name=Name of Application
Icon=/path/to/icon

AFAIK, these are the bare minimums for a .desktop file.

  • Type determines the application group it would be in. For example; Games, Settings, Internet, Other...
  • Terminal, whether it has a terminal for debugging or not
  • Exec, whatever you can run in a single command. It can point to a shell/bash/zsh script to run more complex stuff
  • Name and Icon are obvious, there might be a limit for the Icon size, like max 512x512 pixels, but I'm not sure about that.

After creating this file, copy/move it to ~./local/share/applications for single user setup, or /usr/share/applications for multi-user setups.

DealTime444 avatar
gi flag
This is a good start, but it still doesn't properly integrate the program into the DE. I've actually done this before for a non-WINE program, and I still haven't figured out how to make the program have it's icon/name in the Launcher bar when it's running. Just says "Unknown." You also need to do some manual tinkering to get it to show up in the Right click>Open with menu, which I've also done but forgot how.
Emre Talha avatar
ar flag
If both of my answers can not satisfy your need, then either I'm not able to fully understand your needs, or you need to clarify your question to be a little more specific. Integrating a program into the DE is over my knowledge, but all I can recommend you is to create your own Snap package, maybe this can satisfy your needs. This Digital Ocean [guide](https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04) is a bit old but it might help.
Score:0
md flag

You could use environment variable WINEPREFIX and bubblewrap for hand-made sandboxing.

Another option is sandwine and its argument --dotwine PATH:{ro,rw}. Please be sure to check its threat model in the readme.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.