2

Update

I just verified this problem ONLY happens with opensuse tumberweed on virtual box.

I installed NEON KDE on same Virtual box and did the same exact steps as shown below and the x-bit is not lost while running the script. Only on opensuse tumberweed this happens. Using Latest versions as of today 12/30/2024. All fresh installations from ISO images. So the problem seems to be with opensuse tumberweed guest edition software. I have switched to NEON KDE now to try it.

CASE closed.


I have been using Linux and virtual box for more than 20 years and this is the first time I see this problem. I tried everything and nothing works.

I installed new Linux opensuse tumbleweed, XFCE desktop, on Virtualbox (host is windows 10)

>hostnamectl
   Static hostname: (unset)                                             
Transient hostname: localhost
         Icon name: computer-vm
           Chassis: vm 🖴
    Virtualization: oracle
  Operating System: openSUSE Tumbleweed                                 
       CPE OS Name: cpe:2.3:o:opensuse:tumbleweed:20241129:*:*:*:*:*:*:*
            Kernel: Linux 6.11.8-1-default
      Architecture: x86-64

enter image description here

Everything is working well. I followed the same instructions I always use for each Linux I install on virtual box to share my G:/public_html/ folder. I have done this 100's of times before.

I create mount point at /mnt/g/public_html and my shared folder (which I set during installation of virtual box for Linux) as G:/public_html

Here is the problem. On my shared folder I have many Linux scripts. They all have x bit set.

I noticed when I run a script, it immediately losses the x bit. While the script is running. I check the file from a second terminal using ls -l and see x is gone.

As soon as the script is finished, the x bit comes back !

This only happens on scripts that are on my windows shared folder. Not on scripts that are on my Linux installation, such as $HOME.

So this tells me it has something to do with setting for the shared folder.

What this means, is that if I try to run the same script from another terminal, while it is still running in the first terminal, I get permission denied. I have to wait until the first process is done running the script in order to run it in order for the x bit to be set back automatically.

I have another Linux as guest (Linux endeavour) in different virtual box and this problem does not happen there.

This is what I noticed and I think this could be the cause: On openSUSE when I mount the shared folder, all files have 'me' 'me' as user id and group id. Where 'me' is my user name.

ls -l /mnt/g
total 12
drwxrwxrwx 1 me me 12288 Dec  1 06:45 public_html

On endeavour OS, using same mount command, I get this

ls -l /mnt/g
total 12
drwxrwxrwx 1 me autologin 12288 Dec  1 06:45 public_html

Notice that the group ID is autologin here. The command I use to mount my shared folder is the same on both systems. So I have no idea why one linux using autologin for the group id for the shared folder and another does not. I do not know if this is why the x bit is lost. But this is the only difference I could see.

>cat mount_win.sh 
mount -t vboxsf -o uid=1000,gid=1000 public_html /mnt/g/public_html
>id
uid=1000(me) gid=1000(me) groups=1000(me)
>

I also tried adding exec to the above mount command, but it did not help.

The above mount command is the same I always use for each new Linux I install on Virtual box. It always worked.

I made small movie below to show this (click on it to enlarge).

The script does sleep for 20 seconds. While it is running, you see that the x bit is lost until the script is finished. Watch the left terminal how ls -l now showing no x while script is running.

>cd /mnt/g/public_html/LINUX_HOME_FILES/
>ls -l T.sh
-rwxrwxrwx 1 me me 70 Dec  1 16:09 T.sh
>
>cat T.sh
#!/bin/bash

echo "starting script"
sleep 20s
echo "finishing script"
>

enter image description here

Anything else I can try or any other information needed, please let me know.

could you cat out your group file

On opensuse (where the problem is):

>cat /etc/group
root:x:0:
etc..
vboxguest:x:467:
vboxsf:x:466:
vnc:x:465:
me:!:1000:
>

On EOS (where there is no problem):

>cat /etc/group
root:x:0:root
etc...
autologin:x:1000:me
me:x:1001:
vboxsf:x:109:
>

So on opensuse the file is missing autologin entry, and 'me' says 1000. But on EOS where there is no problem, the autologin entry is there (1000) but 'me' now says 1001. That is why when I used same command to mount shared folder

mount -t vboxsf -o uid=1000,gid=1000 public_html /mnt/g/public_html

On EOS, the group was autologin but on opensuse it was 'me'.

I do not know what all this means and why opensuse is missing autologin in the group file.

It is a nightmere getting shared folder to work OK with virtual box. So I am now moving back to WSL 2.0 on windows, where none of these issues come up. Nothing to mount. All my windows drive can be accessed directly using /mnt/g and /mnt/e and so on from WSL Linux. Much easier.

11
  • could you cat out your group file. I'm wondering if there's a missing entry for autologin or duplicate entries for gid 1000. I don't know why that would cause this behavior though unless it's something on the windows side. Commented Dec 2, 2024 at 13:38
  • @user103944 update with info you asked for. It seems related to autologin missing from group. But have no idea why and how. I just followed same instructions I do each time. Could be problem with opensuse itself. Commented Dec 2, 2024 at 14:58
  • 1
    FWIW Google led to this 5 year old report of the same thing: virtualbox.org/ticket/18877 Commented Dec 2, 2024 at 15:15
  • @muru thanks. Yes it looks same. But I do not understand what I need to resolve this. It says I need to use automount? so do I need to change my mount command to automount and keep the rest of the command the same? Will try now and see. Never used automount before. Commented Dec 2, 2024 at 16:51
  • 1
    @muru I tried it. It worked in the sense that the x bit did not flip. But now all my files on windows show the owner is root and the group is vboxsf. Before, when I mounted it myself, all the files had "me" as owner. I do not want the share folder to be have owner as the root. I need to find out why this happens and see if I can change it. But at least the x bit now do not flip ! Commented Dec 2, 2024 at 18:26

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.