Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gentoo on virtualbox host: building on a shared folder?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
grosmano
n00b
n00b


Joined: 02 Jul 2012
Posts: 34

PostPosted: Sun Jun 11, 2023 11:42 am    Post subject: gentoo on virtualbox host: building on a shared folder? Reply with quote

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
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Sun Jun 11, 2023 12:57 pm    Post subject: Reply with quote

You do not need rust.
Plz use rust-bin
Code:

emerge -1av rust-bin

_________________
:)
Back to top
View user's profile Send private message
grosmano
n00b
n00b


Joined: 02 Jul 2012
Posts: 34

PostPosted: Sun Jun 11, 2023 1:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Sun Jun 11, 2023 2:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
grosmano
n00b
n00b


Joined: 02 Jul 2012
Posts: 34

PostPosted: Sun Jun 11, 2023 3:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54304
Location: 56N 3W

PostPosted: Sun Jun 11, 2023 3:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
grosmano
n00b
n00b


Joined: 02 Jul 2012
Posts: 34

PostPosted: Sun Jun 11, 2023 4:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21709

PostPosted: Sun Jun 11, 2023 4:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
grosmano
n00b
n00b


Joined: 02 Jul 2012
Posts: 34

PostPosted: Mon Jun 12, 2023 6:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21709

PostPosted: Mon Jun 12, 2023 6:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum