-
Notifications
You must be signed in to change notification settings - Fork 686
Insufficient permissions inside created Instance to install npm
packages
#2528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @OlegGulevskyy, I do not see this as a bug in Multipass. I can mount a folder I own on an instance in MacOS, even under |
On the other hand, do you have write permissions (in the host) on the folder you are mounting? I can perfectly reproduce your setup (without |
Nope, sorry for the confusion - ** 2 stars was just a placeholder for the user name of the PC, nothing important |
Where are you running Can you give us a complete sequence to reproduce the bug? |
I was running Complete sequence is:
Thank you for looking into it |
I couldn't reproduce, |
sorry for stupid question - is there anything else I can check apart from |
That check should suffice. Did you check removing the mount, restarting the instance and mounting again? |
Just tried:
does it matter that the shared folder in virtual instance is on the same level as |
That shouldn't be a problem, but you can try in another place. Do you have sufficient disk space? Did you try with another project using |
Just to echo @luis4a0 here, I'm unable to reproduce either. Could you also list which |
I get this too randomly. Sometimes installs work just fine, other times they start to get that error partway through the install. They'll be able to create a bunch of directories leading up to that point, but then suddenly partway through it seems like it loses permission somehow. |
@OlegGulevskyy, @Qard: I wonder if you're hitting a maxfiles limit? We have seen permissions being denied when trying to open files beyond that. Could you try these instructions and see if that helps you by any chance? |
@OlegGulevskyy @Qard @ricab I was able to fix this issue on Monterey, it was indeed a maxfiles limit problem. The trick is to reload the
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string>64000</string>
<string>524288</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxproc</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
<string>maxproc</string>
<string>12784</string>
<string>14176</string>
</array>
<key>RunAtLoad</key>
<true />
<key>ServiceIPC</key>
<false />
</dict>
</plist>
sudo chown -R root:wheel /Library/LaunchDaemons/limit.maxproc.plist
sudo chown -R root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
sudo launchctl load /Library/LaunchDaemons/com.canonical.multipassd.plist |
I fix it by running npm install out of ubuntu instance shell. Use your default terminal and run |
Looks like this issue is back with the latest Ventura version... When getting the error, run the following (thanks to https://developer.apple.com/forums/thread/735798): multipass stop --all
sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
sudo launchctl limit maxfiles 256 unlimited
sudo launchctl limit maxfiles 128000 524288
sudo launchctl load /Library/LaunchDaemons/com.canonical.multipassd.plist I have not checked how to persist this change yet, so it needs to be done after each reboot. Edit: tested on Sonoma 14.0, works as expected. |
Describe the bug
When created instance of Ubuntu 20.x and mount a folder to be shared - cannot install
npm
packages:I cannot install the packages on the host and run on Ubuntu because it seems like the installed packages are not compatible with Ubuntu (my host is MacOS), so it needs to install packages itself.
Am I mounting the folder wrongly that leaves the instance with lack of permissions or is there something else that might be missing?
To Reproduce
How, and what happened?
multipass mount ./project-folder-on-host instance-name:/name-alias
npm install
inside the mounted folderExpected behavior
Packages to be able to install with sufficient permissions for the created instance to write / read files
Logs
Above
Additional info
multipass version
- 1.8.1multipass info --all
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: