Bug 274817 - emulators/virtualbox-ose: add option to build vboximg-mount
Summary: emulators/virtualbox-ose: add option to build vboximg-mount
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Eugene Grosbein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-30 18:03 UTC by Eugene Grosbein
Modified: 2023-11-16 11:11 UTC (History)
1 user (show)

See Also:
eugen: maintainer-feedback-


Attachments
for Makefile of the port (1.83 KB, patch)
2023-10-30 18:03 UTC, Eugene Grosbein
no flags Details | Diff
for pkg-plist (607 bytes, patch)
2023-10-30 18:03 UTC, Eugene Grosbein
no flags Details | Diff
extra patch to files/ directory (499 bytes, patch)
2023-10-30 18:04 UTC, Eugene Grosbein
no flags Details | Diff
single ready-to-commit patch (3.61 KB, patch)
2023-10-30 18:20 UTC, Eugene Grosbein
no flags Details | Diff
single ready-to-commit patch (3.61 KB, patch)
2023-10-30 18:22 UTC, Eugene Grosbein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein freebsd_committer freebsd_triage 2023-10-30 18:03:10 UTC
Created attachment 245999 [details]
for Makefile of the port

Hi!

Proposed change introduces new port option VBOXIMG that enables building and installing "vboximg-mount" utility. It is not enabled by default as it needs fusesfs-libs as another dependency.
Comment 1 Eugene Grosbein freebsd_committer freebsd_triage 2023-10-30 18:03:55 UTC
Created attachment 246000 [details]
for pkg-plist
Comment 2 Eugene Grosbein freebsd_committer freebsd_triage 2023-10-30 18:04:50 UTC
Created attachment 246001 [details]
extra patch to files/ directory
Comment 3 Eugene Grosbein freebsd_committer freebsd_triage 2023-10-30 18:20:08 UTC
Created attachment 246002 [details]
single ready-to-commit patch
Comment 4 Eugene Grosbein freebsd_committer freebsd_triage 2023-10-30 18:22:03 UTC
Created attachment 246003 [details]
single ready-to-commit patch

Correct VBOXIMG_DESC
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2023-10-30 21:51:41 UTC
Did you test vboximg-mount and it work fine?
On which versions of the FreeBSD did you tested?
Comment 6 Eugene Grosbein freebsd_committer freebsd_triage 2023-10-30 23:02:25 UTC
(In reply to Vladimir Druzenko from comment #5)

Yes, it was tested with 13.2-STABLE/amd64 and it works just fine. Also, another FreeBSD user of @freebsd_ru Telegramm chat room has tested it successfully.
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2023-11-09 12:31:37 UTC
Building in progress…
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2023-11-10 10:25:42 UTC
Build fine in poudriere 13.2, 12.4 and on live 13.2.
But can you describe steps to use it with VMs on non-root users?
Comment 9 Eugene Grosbein freebsd_committer freebsd_triage 2023-11-10 10:37:07 UTC
(In reply to Vladimir Druzenko from comment #8)

The utility is not for running VMs. It is to gain access to images like VDI etc. And I tested it using root only. I do not know if it is meant to be used by non-root.
Comment 10 Vladimir Druzenko freebsd_committer freebsd_triage 2023-11-10 11:11:30 UTC
(In reply to Eugene Grosbein from comment #9)
> The utility is not for running VMs. It is to gain access to images like VDI etc.
Yes, I know.
My english is poor - probably my question isn't clear…

If my VM configured for non-root user, VM is stopped, how to mount it with root user?
I got list of partitions, but I can't mount any:

# vboximg-mount --image /path/to/system.vdi --list

Virtual disk image:

   Base: /path/to/system.vdi
   UUID: 66d60720-0a8a-40a1-8d52-8281340b4877

Partition      Boot    Start  Sectors     Size      Offset  Type     
system.vdi(0)             40  984       492.0K       20480  FreeBSD  
system.vdi(1)           1024  2097152     1.0G      524288  FreeBSD  
system.vdi(2)        2098176  4194304     2.0G  1074266112  FreeBSD  
system.vdi(3)        6292480  2097152     1.0G  3221749760  FreeBSD  
system.vdi(4)        8389632  25164760   11.9G  4295491584  FreeBSD 

# mkdir m
# vboximg-mount -i /path/to/system.vdi m
# ls -la m
total 2150141
drwxr-xr-x   2 root        wheel                 0  1 янв.   1970 .
drwxr-xr-x  10 root        wheel                35 10 нояб. 14:05 ..
lr--r--r--   1 root        wheel                 0  7 нояб. 05:29 system.vdi -> /path/to/system.vdi
-rw-r--r--   1 4294967295  4294967295  17179869184 10 нояб. 14:05 vhdd
-rw-rw-rw-   1 root        wheel            503808  1 янв.   1970 vol0
-rw-rw-rw-   1 root        wheel        1073741824  1 янв.   1970 vol1
-rw-rw-rw-   1 root        wheel        2147483648  1 янв.   1970 vol2
-rw-rw-rw-   1 root        wheel        1073741824  1 янв.   1970 vol3
-rw-rw-rw-   1 root        wheel       12884357120  1 янв.   1970 vol4
# mount m/vol1 /mnt/
mount: m/vol1: Block device required

But while I write this message I run commands:
# mdconfig m/vol1
md0
# mount /dev/md0 /mnt
And it work for me - I can "ls /mnt" and see files!
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2023-11-10 11:46:58 UTC
Eugene, waiting maintainer timeout and you can commit it self - 3 days left. :-)
Comment 12 Eugene Grosbein freebsd_committer freebsd_triage 2023-11-10 18:27:04 UTC
(In reply to Vladimir Druzenko from comment #10)

Ether add "vboximg-mount -g" option, or use mdconfig as you have done already.
Comment 13 Vladimir Druzenko freebsd_committer freebsd_triage 2023-11-15 21:22:26 UTC
Maintainer timeout - you can commit this patch self.
If you want you can add me as "Tested by:".
Comment 14 commit-hook freebsd_committer freebsd_triage 2023-11-16 11:06:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6c5da516ce5b8ec11e70c5b433e7164c14453d0a

commit 6c5da516ce5b8ec11e70c5b433e7164c14453d0a
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2023-11-16 11:05:14 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2023-11-16 11:05:42 +0000

    emulators/virtualbox-ose: add option to build vboximg-mount

    Introduce new port option VBOXIMG that enables building and installing
    "vboximg-mount" utility. It is not enabled by default as it needs
    fusesfs-libs as another dependency.

    The utility gives access to insides of VM images like .vdi files etc.
    Use "vboximg-mount -g" to get access to files on internal file systems
    not supported by native FreeBSD mount command. Refer to utility's
    internal online help for syntax details and to original documentation:

    https://docs.oracle.com/en/virtualization/virtualbox/6.0/user/vboximg-mount.html

    PR:             274817
    Tested by:      vvd
    Approved by:    vbox (maintainer timeout over 2 weeks)

 emulators/virtualbox-ose/Makefile                      | 18 ++++++++++++++++--
 .../files/extrapatch-vboximg-Config.kmk (new)          | 11 +++++++++++
 emulators/virtualbox-ose/pkg-plist                     |  2 ++
 3 files changed, 29 insertions(+), 2 deletions(-)