How to run VirtualBox Guest Additions on a Linux guest when it says Permission Denied even as root

While updating VirtualBox Guest Additions for a minor version upgrade on v7, I ran into an odd issue where I couldn't run a shell script with sudo or even as root, and the appropriate execute flag set. I ended up having to run in a separate shell to get it to work. I don't recall this happening before. Here's are my attempts below, along with a screenshot and the capture of it finally working.


user@linuxmint:/media/cdrom$ ls -la
total 48888
dr-xr-xr-x 5 root root     2742 Feb  6 05:09 .
drwxr-xr-x 5 root root     4096 Mar  4  2024 ..
-r--r--r-- 1 root root     1048 Oct 23 11:00 AUTORUN.INF
-r-xr-xr-x 1 root root     7003 Feb  6 04:40 autorun.sh
dr-xr-xr-x 2 root root     1468 Feb  6 05:09 cert
dr-xr-xr-x 2 root root     1252 Feb  6 05:09 NT3x
dr-xr-xr-x 2 root root     2828 Feb  6 05:09 OS2
-r-xr-xr-x 1 root root     5096 Feb  6 04:40 runasroot.sh
-r--r--r-- 1 root root      653 Feb  6 05:09 TRANS.TBL
-r--r--r-- 1 root root  2095024 Feb  6 04:49 VBoxDarwinAdditions.pkg
-r-xr-xr-x 1 root root     4224 Feb  6 04:49 VBoxDarwinAdditionsUninstall.tool
-r-xr-xr-x 1 root root  2896347 Feb  6 04:55 VBoxLinuxAdditions-arm64.run
-r-xr-xr-x 1 root root  6633925 Feb  6 04:40 VBoxLinuxAdditions.run
-r--r--r-- 1 root root  9541632 Feb  6 04:42 VBoxSolarisAdditions.pkg
-r-xr-xr-x 1 root root 17463792 Feb  6 05:07 VBoxWindowsAdditions-amd64.exe
-r-xr-xr-x 1 root root  1070688 Feb  6 04:44 VBoxWindowsAdditions.exe
-r-xr-xr-x 1 root root 10325800 Feb  6 05:07 VBoxWindowsAdditions-x86.exe
-r--r--r-- 1 root root      261 Oct 23 11:00 windows11-bypass.reg

user@linuxmint:/media/cdrom$ sudo ./autorun.sh
sudo: unable to execute ./autorun.sh: Permission denied

user@linuxmint:/media/cdrom$ sudo ./VBoxLinuxAdditions.run
sudo: unable to execute ./VBoxLinuxAdditions.run: Permission denied

user@linuxmint:/media/cdrom$ sudo su root

root@linuxmint:/media/cdrom0# ./VBoxLinuxAdditions.run
bash: ./VBoxLinuxAdditions.run: Permission denied

root@linuxmint:/media/cdrom0# ./runasroot.sh
bash: ./runasroot.sh: Permission denied

root@linuxmint:/media/cdrom0# ./VBoxLinuxAdditions.run
bash: ./VBoxLinuxAdditions.run: Permission denied

root@linuxmint:/media/cdrom0# sh autorun.sh

 



After running from root using "sh autorun.sh", it was able to successfully execute:

VirtualBox Guest Additions installer
Removing installed version 7.0.12 of VirtualBox Guest Additions...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Setting up modules
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup 
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Kernel headers not found for target kernel 
6.1.0-30-amd64. Please install them and execute
  /sbin/rcvboxadd setup
VirtualBox Guest Additions: Running kernel modules will not be replaced until 
the system is restarted or 'rcvboxadd reload' triggered
VirtualBox Guest Additions: reloading kernel modules and services
VirtualBox Guest Additions: kernel modules and services unknown reloaded
VirtualBox Guest Additions: NOTE: you may still consider to re-login if some 
user session specific services (Shared Clipboard, Drag and Drop, Seamless or 
Guest Screen Resize) were not restarted automatically
Press Return to close this window...

Comments

Popular posts from this blog

Domain registrar pricing comparison (2014)

usoclient.exe in Windows 10 wakes up my PC with Wake Source: Unknown

How to block the Admiral anti ad-block detection message