View previous topic :: View next topic |
Author |
Message |
grosmano n00b
Joined: 02 Jul 2012 Posts: 34
|
Posted: Sun Jun 11, 2023 11:42 am Post subject: gentoo on virtualbox host: building on a shared folder? |
|
|
Hello,
I started to play with the installation of Gentoo on a virtual machine (virtualbox). The size of the virtual hard drive is only 20 GB, which i thought would be sufficient but it appears there is not enough space to build dev-lang/rust, which is brought as a dependency of gtk+. I thought that could be fixed by simply mounting a shared folder on /var/tmp/portage but it does not seem that straightforward: though either root or a regular user belonging to the vboxsf group can write in the shared folder, emerge fails and returns an error which looks like this (unfortunately i could only read the final lines):
Code: |
File "/usr/lib/python3.11/site-packages/_emerge/EbuildBuildDir.py", line 115, in async_lock catdir_lock.start()
File "/usr/lib/python3.11/site-packages/_emerge/AsynchronousTask.py", line 34, in start self.start()
File "/usr/lib/python3.11/site-packages/_emerge/AsynchronousLock.py", line 55, in start self._imp = lockfile(
^^^^^^^^^
File "/usr/lib/python3.11/site-packages/portage/locks.py", line 167, in lockfile lock = _lockfile_iteration(
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/portage/locks.py", line 384, in _lockfile_iteration (removed, fstat_result) = _lockfile_was_removed(myfd, lockfilename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/portage/locks.py", line 441, in _lockfile_was_removed_raise_exc(e)
File "/usr/lib/python3.11/site-packages/portage/util/install_mask.py", line 156, in _raise_exc wrapper
portage.exception.OperationNotPermitted: [Errno 1] Operation Not Permitted: b'/var/tmp/portage/.x11-terms.portage_lockfile' -> b'/var/tmp/portage/.x11-terms.portage_lockfile.hardlock-gentoo_i686vm-1752'
|
Since it suggests a problem of permissions, i tried to add portage to the vboxsf group but that did not make any difference. I also tried to remount the shared folder on /var/tmp/portage with uid=portage and gid=portage, which did not work either. Any idea what is the problem and if there would be any way to build packages on a shared folder? |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Sun Jun 11, 2023 12:57 pm Post subject: |
|
|
You do not need rust.
Plz use rust-bin
Code: |
emerge -1av rust-bin
|
_________________
|
|
Back to top |
|
|
grosmano n00b
Joined: 02 Jul 2012 Posts: 34
|
Posted: Sun Jun 11, 2023 1:38 pm Post subject: |
|
|
That is indeed the easieast way to fix the problem directly at the source, thanks
I should admit that i would still be curious to know what is causing the error and wether there is a way to achieve what i was trying to do, if someone has a clue. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Sun Jun 11, 2023 2:59 pm Post subject: |
|
|
Maybe portage can not chown a lockfile or something like that.
Plz run emerge as root.
What is the output of
Code: |
ls -ld /var/tmp/portage
mount | grep portage
|
_________________
|
|
Back to top |
|
|
grosmano n00b
Joined: 02 Jul 2012 Posts: 34
|
Posted: Sun Jun 11, 2023 3:23 pm Post subject: |
|
|
Yes, i run emerge as root. Here is the output after remounting the shared folder:
Code: |
gentoo_i686vm ~ # mount | grep var/tmp
portage-build on /var/tmp/portage type vboxsf (rw,nodev,relatime,iocharset=utf8,uid=250,gid=250)
gentoo_i686vm ~ # ls -ld /var/tmp/portage
drwxrwxr-x 1 portage portage 4096 11 juin 17:16 /var/tmp/portage
|
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54304 Location: 56N 3W
|
Posted: Sun Jun 11, 2023 3:31 pm Post subject: |
|
|
grosmano,
What is the filesystem in the shared folder?
It must be something that understands *NIX permissions, so not NTFS or vfat.
Is expanding the virtual disk or adding another virtual disk an option? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
grosmano n00b
Joined: 02 Jul 2012 Posts: 34
|
Posted: Sun Jun 11, 2023 4:09 pm Post subject: |
|
|
The shared folder is on an ext4 partition in the host (actually Gentoo as well but different arch). As seen from the host all files in the shared folder belong to the user running virtualbox, and in the guest their ownership appears to be dependent on the options passed to mount it, which i was not expecting. Here is an example :
Code: |
gentoo_i686vm ~ # echo "muh?" > /var/tmp/portage/cow
gentoo_i686vm ~ # ls -l /var/tmp/portage
total 4
-rw-r--r-- 1 portage portage 5 11 juin 17:43 cow
gentoo_i686vm ~ # umount portage-build
gentoo_i686vm ~ # mount -t vboxsf portage-build /var/tmp/portage
gentoo_i686vm ~ # ls -l /var/tmp/portage
total 4
-rw-r--r-- 1 root root 5 11 juin 17:43 cow
|
As can be seen the file created by root initially belongs to portage, which was the uid used to mount the folder, and then to root after remounting the shared folder without options. Would portage need to create files with another uid than portage in /var/tmp/portage?
Indeed it will probably be easiest to expand the virtual disk or temporarily create a second one to build the biggest packages. Thank you for the suggestion! |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 21709
|
Posted: Sun Jun 11, 2023 4:39 pm Post subject: |
|
|
The host may back that shared directory with ext4, but the guest's filesystem is the more important part, and the answer to that appears to be that it is the vboxsf filesystem. This pseudo-filesystem likely delegates to the host for data storage, but may have access semantics very different from typical ext4, as seen by the programs running in the guest. |
|
Back to top |
|
|
grosmano n00b
Joined: 02 Jul 2012 Posts: 34
|
Posted: Mon Jun 12, 2023 6:10 pm Post subject: |
|
|
So if i understand properly it is not going to be possible to have PORTAGE_TMPDIR set on a folder with this pseudo-filesystem. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 21709
|
Posted: Mon Jun 12, 2023 6:48 pm Post subject: |
|
|
Your results so far agree with that. I have no experience with this pseudo-filesystem, so I cannot say whether it is able to do this correctly. |
|
Back to top |
|
|
|