dockur / windows

Windows inside a Docker container.
MIT License
17.49k stars 1.5k forks source link

podman with volume option: Permission denied #618

Open sladiri opened 3 months ago

sladiri commented 3 months ago

Operating system

openSUSE Aeon

Adding more info since its fairly new:

lsb_release -a
LSB Version:    n/a
Distributor ID: openSUSE
Description:    openSUSE Tumbleweed
Release:    20240619
Codename:   n/a

cat /etc/os-release 
NAME="openSUSE Aeon"
# VERSION="20240618"
ID="opensuse-aeon"
ID_LIKE="suse opensuse opensuse-tumbleweed opensuse-microos"
VERSION_ID="20240618"
PRETTY_NAME="openSUSE Aeon"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:aeon:20240618"
BUG_REPORT_URL="https://bugzilla.opensuse.org"
SUPPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.aeondesktop.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Aeon"
LOGO="distributor-logo-Aeon"

Description

When adding a volume parameter, the container fails. I tried both a directory in home ~ and /tmp

Docker compose

podman run -it --rm --publish 8006:8006 --publish 3389:3389/tcp --publish 3389:3389/udp --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 -v /tmp:/storage dockurr/windows

Docker log

 Starting Windows for Docker v3.12...
❯ For support visit https://github.com/dockur/windows
❯ CPU: 13th Gen Intel Core TM i7 1370P | RAM: 39/63 GB | DISK: 32 GB (tmpfs) | HOST: 6.9.5-1-default...

find: '/storage': Permission denied
mkdir: cannot create directory '/storage/tmp': Permission denied
❯ Requesting Windows 11 from Microsoft server...
❯ ERROR: Microsoft blocked the automated download request based on your IP address.
❯ Failed to download Windows 11, will try a diferent method now...
❯ Downloading product information from Microsoft server...
mkdir: cannot create directory '/storage/tmp': Permission denied
/storage/tmp/esd/catalog.cab: No such file or directory
❯ ERROR: Failed to download https://go.microsoft.com/fwlink?linkid=2156292 , reason: 1
❯ Failed to download Windows 11, will try another mirror now...
df: /storage/tmp: No such file or directory
❯ ERROR: Not enough free space left to download file!
❯ Failed to download Windows 11, will try another mirror now...
df: /storage/tmp: No such file or directory
❯ ERROR: Not enough free space left to download file!

Screenshots (optional)

No response

haininhhoang94 commented 2 weeks ago

i guess it is the SElinux. try to add :Z to overcome this

    volumes:
      - ./src:/home/ubuntu/src:Z

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/using_selinux/changing-selinux-states-and-modes_using-selinux#changing-to-permissive-mode_changing-selinux-states-and-modes or may use: sudo getenforce 1 but it is only temporary. use the :Z above is better

homoioi commented 2 days ago

You may try it as no-privileged user.