global wine installation
global wine installation
Hello forum,
I am a Teacher at a German school and I want to get rid of Windows.
I successfully installed Ubuntu 10.04LTS and configured the system to
run as needed.
My Problem is the following:
I have 900 Users. If all of them use wine to start a program, every user installs his own .wine directory with all the content.
Soon I have gigabytes of redundant stuff.
Also I need to install some winetricks and I don't want to let the users do so.
With linux programmes (and with wine itself) I can install everything global with sudo.
How can I install the needed wine-components and the needed "helpers" (e.g. mdac28) global as well?
Thanks for your help
Roland
I am a Teacher at a German school and I want to get rid of Windows.
I successfully installed Ubuntu 10.04LTS and configured the system to
run as needed.
My Problem is the following:
I have 900 Users. If all of them use wine to start a program, every user installs his own .wine directory with all the content.
Soon I have gigabytes of redundant stuff.
Also I need to install some winetricks and I don't want to let the users do so.
With linux programmes (and with wine itself) I can install everything global with sudo.
How can I install the needed wine-components and the needed "helpers" (e.g. mdac28) global as well?
Thanks for your help
Roland
robuntu I am sorry I have some really bad news.
http://bugs.winehq.org/show_bug.cgi?id=10495
Wine really does not support multi user. There has been lack of developers and resources required to cure this problem. Wine itself only provides 1 secuirty level to applications being administrator.
Implementing this is basically a large project to say the least.
Now I do have a few reduction things. Some duplicate file hunters for Linux support hard linking to master copies. So reducing the overhead. Using lessfs for wine directories is another option.
Basically no good option really. Normally while in migration I end up deploying a windows terminal server. And use that for the remaining apps.
http://bugs.winehq.org/show_bug.cgi?id=10495
Wine really does not support multi user. There has been lack of developers and resources required to cure this problem. Wine itself only provides 1 secuirty level to applications being administrator.
Implementing this is basically a large project to say the least.
Now I do have a few reduction things. Some duplicate file hunters for Linux support hard linking to master copies. So reducing the overhead. Using lessfs for wine directories is another option.
Basically no good option really. Normally while in migration I end up deploying a windows terminal server. And use that for the remaining apps.
bad news
hi oiaohm,
this is bad news in deed.
a windows terminal server is no solution as I will not pay for microsoft anymore. I am "on a mission", as my colleges say, to really have Linux as the only operating system in our network.
What about creating a /usr/share/drive_c folder, filling it with windows, program files, wintricks, etc. and giving it to root. Than create a .wine folder and a .wine/drive_c folder in the /etc/skel and place some softlinks like ln -s /usr/share/drive_c/windows windows in the /etc/skel/.wine/drive_c
This would mean, a normal user could not install any wine programs, because the windows, program files and others belong to root, but this would be fine for me.
This would reduce the individual size of .wine to a couple of kbytes.
Personal windows data should be stored in drive_c/users anyway so this should work. Tell me if I am wrong with that!
I know this is a workaround and I will face problems after installing new software, because the users don't know. But here I could change the global gnome menu and add some starters there.
I just hoped to be able to do so automatically.
How do other admins face this problem?
Greetings
Roland
this is bad news in deed.
a windows terminal server is no solution as I will not pay for microsoft anymore. I am "on a mission", as my colleges say, to really have Linux as the only operating system in our network.
What about creating a /usr/share/drive_c folder, filling it with windows, program files, wintricks, etc. and giving it to root. Than create a .wine folder and a .wine/drive_c folder in the /etc/skel and place some softlinks like ln -s /usr/share/drive_c/windows windows in the /etc/skel/.wine/drive_c
This would mean, a normal user could not install any wine programs, because the windows, program files and others belong to root, but this would be fine for me.
This would reduce the individual size of .wine to a couple of kbytes.
Personal windows data should be stored in drive_c/users anyway so this should work. Tell me if I am wrong with that!
I know this is a workaround and I will face problems after installing new software, because the users don't know. But here I could change the global gnome menu and add some starters there.
I just hoped to be able to do so automatically.
How do other admins face this problem?
Greetings
Roland
robuntu there are a lot of ways that bring trouble.
Lot of programs write files where you will not be excepting.
Other admins have faced the same problems.
There is a reason why I said migration. Best way is to systematically do way with the requirement of the windows applications over time.
Really it needs wine design altered so it works. Yes the problem of Linux becoming more and more mainstream and wine not being ready for it.
Wine when it first started out the issue of multi users was not even considered. The problem these design errors always come back at some point. Issue is having the resources to deal with it.
Hacks and tricks only will get you so far.
oiaohm
Lot of programs write files where you will not be excepting.
Other admins have faced the same problems.
There is a reason why I said migration. Best way is to systematically do way with the requirement of the windows applications over time.
Really it needs wine design altered so it works. Yes the problem of Linux becoming more and more mainstream and wine not being ready for it.
Wine when it first started out the issue of multi users was not even considered. The problem these design errors always come back at some point. Issue is having the resources to deal with it.
Hacks and tricks only will get you so far.
oiaohm
This is definitely not supported, or a suggested way to go mainly for security reasons..
I'll give you some ideas on how you might do this, using some custom scripts. You need to test it thoroughly for the specific apps you will run, and it leaves any user open to be able to trash the wineprefix...
I don't think this would work for any type of network share, or multiple users running the same program at the same time.
You'd need to make a common folder all users have full read/write permissions to, and make your wineprefix a folder inside of that folder, and also change it and its contents all to full read/write for all users..
Any app would have to be started with some custom type start up script where you would have it change the owner of the wineprefix folder to the current user, change the user name folder inside the prefix to the current user name, and modify all the symlinks in there to point to the current users Documents and Desktop and such.
It does work, but it will lead to security issues with having all that set full read/write for all users... You might get around the most problematic ones by using some clever symlinking of programs in the Wineprefix to other locations where users don't have full read/write, but it could get complicated and messy.
I'll give you some ideas on how you might do this, using some custom scripts. You need to test it thoroughly for the specific apps you will run, and it leaves any user open to be able to trash the wineprefix...
I don't think this would work for any type of network share, or multiple users running the same program at the same time.
You'd need to make a common folder all users have full read/write permissions to, and make your wineprefix a folder inside of that folder, and also change it and its contents all to full read/write for all users..
Any app would have to be started with some custom type start up script where you would have it change the owner of the wineprefix folder to the current user, change the user name folder inside the prefix to the current user name, and modify all the symlinks in there to point to the current users Documents and Desktop and such.
It does work, but it will lead to security issues with having all that set full read/write for all users... You might get around the most problematic ones by using some clever symlinking of programs in the Wineprefix to other locations where users don't have full read/write, but it could get complicated and messy.
-
- Newbie
- Posts: 3
- Joined: Fri Jun 14, 2013 3:13 pm
Re: global wine installation
A simple pam_namespace entry might do what you want. Then just set WINEPREFIX globally to point to the pam_namespace directory. For example:
mkdir /var/wine.template
echo "/var/wine /var/wine/ user:iscript=wine.init" >> /etc/security/namespace.conf
cat << EOF >> /etc/security/namespace.d/wine.init
if [ "$3" = 1 ]; then
user="$4"
passwd=$(getent passwd "$user")
winedir="$1"
gid=$(echo "$passwd" | cut -f4 -d":")
cp -rT /var/wine.template "$winedir"
chown -R "$user":"$gid" "$winedir"
mask=$(awk '/^UMASK/{gsub("#.*$", "", $2); print $2; exit}' /etc/login.defs)
mode=$(printf "%o" $((0777 & ~$mask)))
chmod ${mode:-700} "$winedir"
fi
exit 0
EOF
chmod +x /etc/security/namespace.d/wine.init
echo "export WINEPREFIX=/var/wine" > /etc/profile.d/wineprefix.sh
Then, to do a global install of, e.g Google SketchUp:
1. console login as root
2. verify that /var/wine has been mounted via pam_namespace (e.g. mount | grep "/var/wine")
3. verify that WINEPREFIX is set (i.e echo $WINEPREFIX should show /var/wine)
3. wine msiexec /i GoogleSketchUpWEN.exe /qn
4. sed -i 's/wine.init$/wine.init root/' /etc/security/namespace.conf
5. log off and back on
6. mv /var/wine.template /var/wine.template.old; cp -a /var/wine/root /var/wine.template
7. normal user logons should get personalized /var/wine directories.
To cut down on duplicated data, I think you would have to use some sort of copy-on-write NFS mounts to /var/wine.
Alternative to using NFS cow, a cow disk image could be served from a central server via iscsi.
That is the best that I can come up with.
mkdir /var/wine.template
echo "/var/wine /var/wine/ user:iscript=wine.init" >> /etc/security/namespace.conf
cat << EOF >> /etc/security/namespace.d/wine.init
if [ "$3" = 1 ]; then
user="$4"
passwd=$(getent passwd "$user")
winedir="$1"
gid=$(echo "$passwd" | cut -f4 -d":")
cp -rT /var/wine.template "$winedir"
chown -R "$user":"$gid" "$winedir"
mask=$(awk '/^UMASK/{gsub("#.*$", "", $2); print $2; exit}' /etc/login.defs)
mode=$(printf "%o" $((0777 & ~$mask)))
chmod ${mode:-700} "$winedir"
fi
exit 0
EOF
chmod +x /etc/security/namespace.d/wine.init
echo "export WINEPREFIX=/var/wine" > /etc/profile.d/wineprefix.sh
Then, to do a global install of, e.g Google SketchUp:
1. console login as root
2. verify that /var/wine has been mounted via pam_namespace (e.g. mount | grep "/var/wine")
3. verify that WINEPREFIX is set (i.e echo $WINEPREFIX should show /var/wine)
3. wine msiexec /i GoogleSketchUpWEN.exe /qn
4. sed -i 's/wine.init$/wine.init root/' /etc/security/namespace.conf
5. log off and back on
6. mv /var/wine.template /var/wine.template.old; cp -a /var/wine/root /var/wine.template
7. normal user logons should get personalized /var/wine directories.
To cut down on duplicated data, I think you would have to use some sort of copy-on-write NFS mounts to /var/wine.
Alternative to using NFS cow, a cow disk image could be served from a central server via iscsi.
That is the best that I can come up with.
-
- Newbie
- Posts: 3
- Joined: Fri Jun 14, 2013 3:13 pm
Re: global wine installation
Following up on my previous post, here is a complete, working, and tested setup for a global wine installation.
# GLOBAL WINE INSTALLATION - TESTED ON FEDORA 19
*** Step 1 -- Create the Template WINE Installation
Set the WINEPREFIX environment variable to /var/wine and run wine to create your template wine installation (e.g. sudo mkdir /var/wine; sudo chown $USER /var/wine; WINEPREFIX=/var/wine wine winecfg). Once you have a working wine installation in /var/wine, move it somewhere (e.g. mv /var/wine /var/wine.template) so that you can set up a new /var/wine directory that will be handled by pam_namespace.
*** Step 2 -- Configure PAM Namespace
# create a new, empty /var/wine directory to be handled by pam_namespace
mkdir /var/wine
chmod 0000 /var/wine
# add the /var/wine directory to pam_namespace
cat < EOF >> /etc/security/namespace.conf
/var/wine /var/wine/ user root,gdm
EOF
# enable pam_namespace
cat < EOF >> /etc/pam.d/system-auth
session [default=ignore] pam_namespace.so ignore_instance_parent_mode
session [default=ignore] pam_exec.so /etc/security/wine.init
EOF
*** Step 3 -- Create the script that initializes WINE on user logon.
Following is a script that will mount a copy-on-write disk image to /var/wine. pam_namespace will see to it that each user will see their own disk image. There is a lot of "magic" going on in this script -- pam_namespace, dmsetup snapshot, and sparse files. The end result is a multi-user wine installation with minimal disk usage. Here are a few web links that explain some of the basics:
pam_namespace: http://airtower.wordpress.com/2010/06/2 ... namespace/
snapshots: http://linuxgazette.net/114/kapil.html
sparse files: http://en.wikipedia.org/wiki/Sparse_file
--- BEGIN SCRIPT /etc/security/wine.init ---
#!/bin/sh -p
user=$PAM_USER
pwd=$(getent passwd $user)
uid=$(echo $pwd | cut -d ':' -f 3)
gid=$(echo $pwd | cut -d ':' -f 4)
winedir="/var/wine"
diskdir="$winedir-snapshots"
srcdisk="$diskdir/template"
usrdisk="$diskdir/$user"
srcsize=$(du --apparent-size --block-size=512 "$srcdisk" 2>/dev/null | cut -f 1)
template=$(/sbin/losetup --associated "$srcdisk" | cut -d ':' -f 1)
instance=$(/sbin/losetup --associated "$usrdisk" | cut -d ':' -f 1)
if [ -e "$srcdisk" ]; then
if ! [ -e "$usrdisk" ]; then
dd if=/dev/zero of="$usrdisk" bs=512 count=0 seek=$srcsize &>/dev/null
new=1
fi
if [ -z "$template" ]; then
template=$(/sbin/losetup --show --find --read-only "$srcdisk")
fi
if [ -z "$instance" ]; then
instance=$(/sbin/losetup --show --find "$usrdisk")
fi
if ! [ -e "/dev/mapper/$user" ]; then
echo 0 $srcsize snapshot $template $instance p 8 | /sbin/dmsetup create $user &>/dev/null
fi
if ! mount | grep "^/dev/mapper/$user\b" &>/dev/null; then
mount /dev/mapper/$user "$winedir" &>/dev/null
fi
# 7420 was the uid of my template user; you will need to change this to
# whatever is in your /var/wine.template/drive_c/users/ directory (it may be the username)
if ! [ -e "$winedir/drive_c/users/$user" ]; then
ln -s -r "$winedir/drive_c/users/7420" "$winedir/drive_c/users/$user" &>/dev/null
fi
# 7420 was the uid of my template user; you will need to change this to
# whatever is in your /var/wine.template/drive_c/users/ directory (it may be the username)
if ! [ -e "$winedir/drive_c/users/$uid" ]; then
ln -s -r "$winedir/drive_c/users/7420" "$winedir/drive_c/users/$uid" &>/dev/null
fi
if [ "$new" == "1" ]; then
chown --recursive --from=root:root $user:$gid $winedir &>/dev/null
fi
fi
exit 0
--- END SCRIPT ---
chmod +x /etc/security/wine.init
*** Step 4 -- Create the template disk image and populate it with the contents of /var/wine.template
mkdir /var/wine-snapshots
# create a sparse file to hold the template wine installation (modify the size as needed)
dd if=/dev/zero of=/var/wine-snapshots/template bs=1MiB count=0 seek=1024
# put a file system in the template file
mkfs.ext4 /var/wine-snapshots/template
# copy the template wine installation to the template file (disk image) and tweek it
mount /var/wine-snapshots/template /mnt
cp -a /var/wine.template/* /mnt
# 7420 was my uid. Yours will likely be different.
cd /mnt/drive_c/users/7420
# remove any symbolic links and replace them with real directories
find /mnt/drive_c/users/7420 -maxdepth 1 -type l -exec rm -f "{}" \; -exec mkdir "{}" \;
# copy any needed files from the original linked directories to the new real directories. e.g.:
cp "$HOME/Desktop/Google SketchUp 8.desktop" /mnt/drive_c/users/7420/Desktop
cp "$HOME/Desktop/Google SketchUp 8.lnk" /mnt/drive_c/users/7420/Desktop
You might wand to grep for references to your installation username in /mnt/*.reg at this point (e.g. grep jsmith /mnt/*.reg). There shouldn't be any. If there are, they may prevent whatever software you are trying to use from working properly. Ideally, all path references should be anchored in /var/wine (or "C:\"). There may be references to the user's uid in C:\users, but that will be taken care of with a symbolic link that is made by the wine.init script.
chown --recursive root:root /mnt/*
umount /mnt
# copy any needed files from the original template user's home directory to the system-wide location. e.g.:
cp -r ~jsmith/.local/share/applications/wine* /usr/share/applications
cat ~jsmith/.local/share/applications/mimeinfo.cache >> /usr/share/applications/mimeinfo.cache
# make sure that any icons that were copied to /usr/share/applications have the WINEPREFIX variable set correctly. They should look something like the following example:
cat /usr/share/applications/google-sketchup.desktop
[Desktop Entry]
Name=Google SketchUp 8
Exec=env WINEPREFIX="/var/wine" wine C:\\\\Program\\ Files\\\\Google\\\\Google\\ SketchUp\\ 8\\\\SketchUp.exe
Type=Application
StartupNotify=true
Icon=A986_SketchUpIcon.0
That should do it! You should now have a working multi-user, "centralized", wine installation.
P.S. I found the following commands useful for setting up the default icons for my Fedora 19 users:
cat <<- "EOF" > /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override
[org.gnome.shell]
favorite-apps=['firefox.desktop', 'google-chrome.desktop', 'eclipse.desktop', 'netbeans-7.1.2.desktop', 'amarok.desktop', 'gimp.desktop', 'vlc.desktop', 'quoth.desktop', 'kino.desktop', 'fedora-gnomebaker.desktop', 'nautilus.desktop', 'gnome-terminal.desktop', 'inkscape.desktop', 'google-sketchup.desktop']
EOF
glib-compile-schemas /usr/share/glib-2.0/schemas
# GLOBAL WINE INSTALLATION - TESTED ON FEDORA 19
*** Step 1 -- Create the Template WINE Installation
Set the WINEPREFIX environment variable to /var/wine and run wine to create your template wine installation (e.g. sudo mkdir /var/wine; sudo chown $USER /var/wine; WINEPREFIX=/var/wine wine winecfg). Once you have a working wine installation in /var/wine, move it somewhere (e.g. mv /var/wine /var/wine.template) so that you can set up a new /var/wine directory that will be handled by pam_namespace.
*** Step 2 -- Configure PAM Namespace
# create a new, empty /var/wine directory to be handled by pam_namespace
mkdir /var/wine
chmod 0000 /var/wine
# add the /var/wine directory to pam_namespace
cat < EOF >> /etc/security/namespace.conf
/var/wine /var/wine/ user root,gdm
EOF
# enable pam_namespace
cat < EOF >> /etc/pam.d/system-auth
session [default=ignore] pam_namespace.so ignore_instance_parent_mode
session [default=ignore] pam_exec.so /etc/security/wine.init
EOF
*** Step 3 -- Create the script that initializes WINE on user logon.
Following is a script that will mount a copy-on-write disk image to /var/wine. pam_namespace will see to it that each user will see their own disk image. There is a lot of "magic" going on in this script -- pam_namespace, dmsetup snapshot, and sparse files. The end result is a multi-user wine installation with minimal disk usage. Here are a few web links that explain some of the basics:
pam_namespace: http://airtower.wordpress.com/2010/06/2 ... namespace/
snapshots: http://linuxgazette.net/114/kapil.html
sparse files: http://en.wikipedia.org/wiki/Sparse_file
--- BEGIN SCRIPT /etc/security/wine.init ---
#!/bin/sh -p
user=$PAM_USER
pwd=$(getent passwd $user)
uid=$(echo $pwd | cut -d ':' -f 3)
gid=$(echo $pwd | cut -d ':' -f 4)
winedir="/var/wine"
diskdir="$winedir-snapshots"
srcdisk="$diskdir/template"
usrdisk="$diskdir/$user"
srcsize=$(du --apparent-size --block-size=512 "$srcdisk" 2>/dev/null | cut -f 1)
template=$(/sbin/losetup --associated "$srcdisk" | cut -d ':' -f 1)
instance=$(/sbin/losetup --associated "$usrdisk" | cut -d ':' -f 1)
if [ -e "$srcdisk" ]; then
if ! [ -e "$usrdisk" ]; then
dd if=/dev/zero of="$usrdisk" bs=512 count=0 seek=$srcsize &>/dev/null
new=1
fi
if [ -z "$template" ]; then
template=$(/sbin/losetup --show --find --read-only "$srcdisk")
fi
if [ -z "$instance" ]; then
instance=$(/sbin/losetup --show --find "$usrdisk")
fi
if ! [ -e "/dev/mapper/$user" ]; then
echo 0 $srcsize snapshot $template $instance p 8 | /sbin/dmsetup create $user &>/dev/null
fi
if ! mount | grep "^/dev/mapper/$user\b" &>/dev/null; then
mount /dev/mapper/$user "$winedir" &>/dev/null
fi
# 7420 was the uid of my template user; you will need to change this to
# whatever is in your /var/wine.template/drive_c/users/ directory (it may be the username)
if ! [ -e "$winedir/drive_c/users/$user" ]; then
ln -s -r "$winedir/drive_c/users/7420" "$winedir/drive_c/users/$user" &>/dev/null
fi
# 7420 was the uid of my template user; you will need to change this to
# whatever is in your /var/wine.template/drive_c/users/ directory (it may be the username)
if ! [ -e "$winedir/drive_c/users/$uid" ]; then
ln -s -r "$winedir/drive_c/users/7420" "$winedir/drive_c/users/$uid" &>/dev/null
fi
if [ "$new" == "1" ]; then
chown --recursive --from=root:root $user:$gid $winedir &>/dev/null
fi
fi
exit 0
--- END SCRIPT ---
chmod +x /etc/security/wine.init
*** Step 4 -- Create the template disk image and populate it with the contents of /var/wine.template
mkdir /var/wine-snapshots
# create a sparse file to hold the template wine installation (modify the size as needed)
dd if=/dev/zero of=/var/wine-snapshots/template bs=1MiB count=0 seek=1024
# put a file system in the template file
mkfs.ext4 /var/wine-snapshots/template
# copy the template wine installation to the template file (disk image) and tweek it
mount /var/wine-snapshots/template /mnt
cp -a /var/wine.template/* /mnt
# 7420 was my uid. Yours will likely be different.
cd /mnt/drive_c/users/7420
# remove any symbolic links and replace them with real directories
find /mnt/drive_c/users/7420 -maxdepth 1 -type l -exec rm -f "{}" \; -exec mkdir "{}" \;
# copy any needed files from the original linked directories to the new real directories. e.g.:
cp "$HOME/Desktop/Google SketchUp 8.desktop" /mnt/drive_c/users/7420/Desktop
cp "$HOME/Desktop/Google SketchUp 8.lnk" /mnt/drive_c/users/7420/Desktop
You might wand to grep for references to your installation username in /mnt/*.reg at this point (e.g. grep jsmith /mnt/*.reg). There shouldn't be any. If there are, they may prevent whatever software you are trying to use from working properly. Ideally, all path references should be anchored in /var/wine (or "C:\"). There may be references to the user's uid in C:\users, but that will be taken care of with a symbolic link that is made by the wine.init script.
chown --recursive root:root /mnt/*
umount /mnt
# copy any needed files from the original template user's home directory to the system-wide location. e.g.:
cp -r ~jsmith/.local/share/applications/wine* /usr/share/applications
cat ~jsmith/.local/share/applications/mimeinfo.cache >> /usr/share/applications/mimeinfo.cache
# make sure that any icons that were copied to /usr/share/applications have the WINEPREFIX variable set correctly. They should look something like the following example:
cat /usr/share/applications/google-sketchup.desktop
[Desktop Entry]
Name=Google SketchUp 8
Exec=env WINEPREFIX="/var/wine" wine C:\\\\Program\\ Files\\\\Google\\\\Google\\ SketchUp\\ 8\\\\SketchUp.exe
Type=Application
StartupNotify=true
Icon=A986_SketchUpIcon.0
That should do it! You should now have a working multi-user, "centralized", wine installation.
P.S. I found the following commands useful for setting up the default icons for my Fedora 19 users:
cat <<- "EOF" > /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override
[org.gnome.shell]
favorite-apps=['firefox.desktop', 'google-chrome.desktop', 'eclipse.desktop', 'netbeans-7.1.2.desktop', 'amarok.desktop', 'gimp.desktop', 'vlc.desktop', 'quoth.desktop', 'kino.desktop', 'fedora-gnomebaker.desktop', 'nautilus.desktop', 'gnome-terminal.desktop', 'inkscape.desktop', 'google-sketchup.desktop']
EOF
glib-compile-schemas /usr/share/glib-2.0/schemas
-
- Newbie
- Posts: 3
- Joined: Fri Jun 14, 2013 3:13 pm
Re: global wine installation
P.P.S. I forgot to mention in the previous post that you may need to increase the number of loop back devices that are available in the /dev file system. One loop back device will be needed per user and the default number of available devices is 8. If you will be having more than 8 users of wine between reboots of your computer, then you will need to increase the number by adding something like "max_loop=256" to your list of kernel parameters and reloading grub to your boot sector. e.g.:
sed -i '/^GRUB_CMDLINE_LINUX/s|"$| max_loop=256"|' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
sed -i '/^GRUB_CMDLINE_LINUX/s|"$| max_loop=256"|' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
Re: global wine installation
Heya Greg... so I signed up just to have SOMEONE fecking telling you well done!!!
I will try this in the coming days.. I don't know if it works in it's entirety but bloody hell... this topic has been ongoing since at least 2009 so half a decade... someoen potentially coming with a nice, workaround which doesn't involve rewriting wine like feck, should at least warrant some friendly feedback.. so regardless of how solid it is or not.. a big THANK YOU for this Greg...
It surely will be enough to give people ideas to make it work in their required env'ments.
I just have started with wine myself and ended up quickly writing up some ideas, but if others haven't hacked it by now, I doubt I would... so this is a great set of postings!
You have tested it so it should be ok.. although sometimes others have different use cases which give rise to "bugs" or so.
I am in fact a single user myself but can run it by multi-user contexts...
Again, thanks a lot!

one would think a few devs, might say.. hey.. great idea! no matter how solid it's working or not.
Just looking over it it looks good, although I am not sure yet how it will work with custom reg/user stuff but I will see.
I will try this in the coming days.. I don't know if it works in it's entirety but bloody hell... this topic has been ongoing since at least 2009 so half a decade... someoen potentially coming with a nice, workaround which doesn't involve rewriting wine like feck, should at least warrant some friendly feedback.. so regardless of how solid it is or not.. a big THANK YOU for this Greg...
It surely will be enough to give people ideas to make it work in their required env'ments.
I just have started with wine myself and ended up quickly writing up some ideas, but if others haven't hacked it by now, I doubt I would... so this is a great set of postings!
You have tested it so it should be ok.. although sometimes others have different use cases which give rise to "bugs" or so.
I am in fact a single user myself but can run it by multi-user contexts...
Again, thanks a lot!

one would think a few devs, might say.. hey.. great idea! no matter how solid it's working or not.
Just looking over it it looks good, although I am not sure yet how it will work with custom reg/user stuff but I will see.
Re: global wine installation
Ok.. done.
A. As I said.. brilliant 'Gregory'. I assume you are an sysadmin at a school, or corporation or whatnot.. and had this already around for thinclients and thought sheesh... need to help em out.
I can seriously recommend this as how it should be done on linux in multi-user layouts.... although greatly enough this didn't exclude my considerations but rather add to it.
As it stands, I thought I had to come up with some solutions for the usual scenarios: single user wishing to 'isolate' as much as possible his files, aka create a standalone user, and sudo -u thatuser etc etc.... multi users where one wished to have shared resources (this method!!) and finally, mum, dad, child, dont want child to install their own programs but only use wine form shared say... (so they cant install by mistake wine clicked_on_bad.exe) or not_good_for_minor_prog.exe and so on.
So, One can extend this to deal with such scenarios too by using additional wine users, permissions etc. I will leave that to anyone to cater to their own needs.
So a big thank you to Greg and some notes/addendums:
1. I used archlinux and cinnamon to test this:
I noticed: when setting this up, one might wish to use a setup user like wine or default.. as the symlinks created later on for each user will link to the username which was used... eg. 7420 above... myuser in my case. This doesn't change anything but is more aestethic and consistent to not replicate a current user.
You would need toi have that user though or recreate it, when adding/updating the template file, I would imagine.
on cinnamon, I had to also cp .config/applications_merged to /etc/xdg and replace in reg files, the location to reflect this.
I am SO happy you mentioned grepping the reg files, as I would have probably ended up in a nightmare of troubleshooting since I am new to wine, and would assume pam to be the culprit...
But in there, I had indeed actually quite a few references.. to my user.. so had to do some manual replacing, although perhaps it was just me not doing everythign correctly. Either way, it was a simple fix.
Note: the references like C:\users\username are fine.. as username is , as mentioned, the one which will be syminked as the new user's username: eg. in var/wine/drive_c/users/YOU <-s link-> setup-uid/name. Also, if you don't wish all the typicla wine links to point to your home/pictures/videos/documents etc, then you should prolly sandbox it in mnt. Running the above command to remove symlinks was not enough (for me).
Else, easy peasy and works great. The sparse snapshots take up 1-10% say of the prefix... as opposed to a full 100% per user.
I really wish people did this more often, (I am still assuming this came from a working business scenario)... but if too many secrets of the trade came out too quickly, one would be out of work eh :p
hmm oh ye.. I also had some ~/.fonts .. had to move to usr share and update reg... and hmm final thought is I haven't tried updating adding to the template.. and how that would go.. but one just has to do some testing.
Have a nice day and thx !
A. As I said.. brilliant 'Gregory'. I assume you are an sysadmin at a school, or corporation or whatnot.. and had this already around for thinclients and thought sheesh... need to help em out.
I can seriously recommend this as how it should be done on linux in multi-user layouts.... although greatly enough this didn't exclude my considerations but rather add to it.
As it stands, I thought I had to come up with some solutions for the usual scenarios: single user wishing to 'isolate' as much as possible his files, aka create a standalone user, and sudo -u thatuser etc etc.... multi users where one wished to have shared resources (this method!!) and finally, mum, dad, child, dont want child to install their own programs but only use wine form shared say... (so they cant install by mistake wine clicked_on_bad.exe) or not_good_for_minor_prog.exe and so on.
So, One can extend this to deal with such scenarios too by using additional wine users, permissions etc. I will leave that to anyone to cater to their own needs.
So a big thank you to Greg and some notes/addendums:
1. I used archlinux and cinnamon to test this:
I noticed: when setting this up, one might wish to use a setup user like wine or default.. as the symlinks created later on for each user will link to the username which was used... eg. 7420 above... myuser in my case. This doesn't change anything but is more aestethic and consistent to not replicate a current user.
You would need toi have that user though or recreate it, when adding/updating the template file, I would imagine.
on cinnamon, I had to also cp .config/applications_merged to /etc/xdg and replace in reg files, the location to reflect this.
I am SO happy you mentioned grepping the reg files, as I would have probably ended up in a nightmare of troubleshooting since I am new to wine, and would assume pam to be the culprit...
But in there, I had indeed actually quite a few references.. to my user.. so had to do some manual replacing, although perhaps it was just me not doing everythign correctly. Either way, it was a simple fix.
Note: the references like C:\users\username are fine.. as username is , as mentioned, the one which will be syminked as the new user's username: eg. in var/wine/drive_c/users/YOU <-s link-> setup-uid/name. Also, if you don't wish all the typicla wine links to point to your home/pictures/videos/documents etc, then you should prolly sandbox it in mnt. Running the above command to remove symlinks was not enough (for me).
Else, easy peasy and works great. The sparse snapshots take up 1-10% say of the prefix... as opposed to a full 100% per user.
I really wish people did this more often, (I am still assuming this came from a working business scenario)... but if too many secrets of the trade came out too quickly, one would be out of work eh :p
hmm oh ye.. I also had some ~/.fonts .. had to move to usr share and update reg... and hmm final thought is I haven't tried updating adding to the template.. and how that would go.. but one just has to do some testing.
Have a nice day and thx !