VirtualBox image mounter

Post

Posted
Rating:
#1 (In Topic #1312)
Guru
BruceSteers is in the usergroup ‘Guru’
I just started this project that lets me mount any of my virtualbox VMs.

It requires VirtualBox is installed and you have some VM's added to it.

It uses the vboximg-mount command to list the VM's (.vdi files) and mount them as folders.
Then uses mount to mount the drives inside the mounted VMs (requires root)
Root mount commands are done via an internal Terminal process that will ask for password the first time then the terminal is re-used so password only needs entering once.

The VDI's and their internal disk files are mounted in /tmp/gambas.100/VM/ so any mounts are cleared after reboot.

It's a bit WIP at the moment but doing enough to now share to you all.

just double click a VM or press Mount to mount the disks (file browser automatically opens up the largest disk that's hopefully the system)

I may add more stuff like detecting VM gambas versions , or possibly some kind of scripting so you could make your own functions to perform on the VMs
EDIT:
this is now done in the form of custom scripts, by default there re 2 custom menu commands, one gets gambas versions the other prints release files.
VMs can now be launched.

 Note:the initial alpha original version has been removed This is the most recent upload
Bruce Steers / vbox-mounter · GitLab
Read on below to see it's evolution to the current version.

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
Update time :)

Now in this utility are the following updates….

Load external .vdi files.
Now you can open a dialog and select any .vdi file on a disk that is not set up in your VirtualBox config,
The only files you cannot load are copies of a system that IS set up in VirtualBox config.
If the .vdi UUID matches one in your config it cannot be loaded.
Image

(Click to enlarge)


Commands.

You can now add commands to a custom menu.
By default (to show an example) it configures 3 commands to get the version of gambas installed on that VM (one works on selected items, one on mounted items and the last on all)

The commands can be run from a MenuButton on the main window.
Image

(Click to enlarge)


I'm going to refine it a bit still, only just got the menu editor working.
(See first post for latest revision)

Enjoy :)
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
 I realized i had not implemented saving the change of using the selected/mounted or all drives on a command.

then i thought is was silly to have it command independent and better to have the option on the main window instead.

So now only one gambas version command is made and you select what to run it on with the combobox.

EDIT:  now it is selected via the menus not a combobox

(Download in the first post)

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#4
Guru
BruceSteers is in the usergroup ‘Guru’
 okay well i did not like the combobox either so I have changed it now to create 3 main menus in the commands menu Selected,Mounted and All
commands appear in all 3 menus

Added some other features…

Show main splitter horizontally
Hide data panel (just shows the vm info)

Added a menu bar

fixed it throwing an error if you open the root password requester but cancel/close it then close the program right away.

some other fixes/optimizations

(updated archive In the post above)
Online now: No Back to the top

Post

Posted
Rating:
#5
Guru
BruceSteers is in the usergroup ‘Guru’
so…
I was still not happy with the layout.

Now I am :)
I have made the VM list and Data views horizontal split on the top with status below.
Data can be shown / hidden and is now hidden by default

also paths can be hidden from vm list.

refined the Process handler a bit to handle cancellation of root access.

Added some OS logo icons.

I found on a new Ubuntu24 that it did not work because the line #user_allow_other had to be uncommented in /etc/fuse.conf to allow mounting disks.
so now the program checks for this and asks if you want to modify the file and does it for you if you select so. (or if you don't it just cannot mount disks)

Have now removed the initial release from the first post of this thread and added the latest to it.

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#6
Guru
BruceSteers is in the usergroup ‘Guru’
 Todays addition…

There was one thing missing….
Now there is a Start VM button/menu to launch a selected VM

Limitations: only VMs listed/registered in VirtualBox config can be launched

Will probably add some options in the future to choose different start modes (normal, scaled, seamless, fullscreen, etc)
Currently it just starts the VM with no options.

(V1.1.4 in first post)
Online now: No Back to the top

Post

Posted
Rating:
#7
Guru
BruceSteers is in the usergroup ‘Guru’
 I just updated to 1.1.5

Mostly a cross-continental fix due to a bug report from a German user.

Seems my use of Val to turn a String into a Float errors on German machines due to them using commas to separate decimals.

But also they had a Kali VM installed and the information given was in a different format to ALL the other VMs, so i reworked the check a little to handle this.
Online now: No Back to the top

Post

Posted
Rating:
#8
Guru
BruceSteers is in the usergroup ‘Guru’
 A few significant updates…

When starting a VM, there are now some options that can be set.
* Set the screen mode: Normal, Seamless, Scaled, Fullscreen

* Restore from the current snapshot is now enabled by default.
(I just figured out a snapshot is like a hibernation mode and the VM boots much faster from a snapshot so will be using that a bit more)

Also, I enabled translations and scanned all the source code for strings that should be added. There are about 78 maximum (some may not need translation)

Added a Readme.md

Version 1.2 uploaded to the first post.
This will probably be final version , possibly some bugfix revisions to come but it think it's got all the features it needs now.
Online now: No Back to the top

Post

Posted
Rating:
#9
Guru
BruceSteers is in the usergroup ‘Guru’
I tried using Gambas' auto-translate feature and did some translations. :)
I added German, French, Italian and Spanish.
Please let me know if something is wrong and should be corrected.

If you do not know how to auto-translate and it's not in your language let me know and i can do it for you.

V.1.2.1
Online now: No Back to the top

Post

Posted
Rating:
#10
Guru
BruceSteers is in the usergroup ‘Guru’
Update V1.2.2 just includes a modified German translation courtesy of Crabman on www.gambas-club.de/
And i removed code to resize the Mount button as it used the English word Browse,
It was intended to set the button a size so it would not auto-resize when changing from Mount to Browse.
Meh, it can resize itself, it's cool 8-)

so not really needed if going from from V1.2.1 for English users.
Online now: No Back to the top

Post

Posted
Rating:
#11
Guru
BruceSteers is in the usergroup ‘Guru’
 PS. Open to feature suggestions.

If there is anything you think it should/could also do then let me know.

If you make any handy must have script commands please let me know and maybe they could get included with the program?
Online now: No Back to the top

Post

Posted
Rating:
#12
Guru
BruceSteers is in the usergroup ‘Guru’
Right , I know I said enough features for now but no, it needed just a little more :)

It seemed silly to me to have to run my gambas version command every time i run the program.

So now there is a thing called StoreData. When a command is run it's output can be added to a VMs StoreData collection.
All command outputs to be stored are put in a file with VM name that is then available to read back.
When clicking a VM it's StoredData can be seen in the Data panel.

By default the data is saved in Temp() and will clear at reboot but there is a menu option to remember (saves in $HOME/.config/vbox-mounter instead)

On the command editor there are some new options (checkbox) for individual commands.

Store result : make the output save the the VMs StoredData
No Unmount:  do not unmount a drive if it's auto-mounted to run the command.
Quiet:  do not print the output to the Status panel.

More visual improvements.
Now a camera icon shows next to the VM name if it has a Snapshot
Now an Info icon shows next to the VM name if there is StoredData

More visual customizations.
Show or hide Data panel and/or Status panel
Choose what fields to show in the Data panel.

Made a Readme.md , sort of instructions :)

V 1.2.3 in the first post :)

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#13
Guru
BruceSteers is in the usergroup ‘Guru’
 PS. if using an older version you may have to open the Command editor and set the "Store result" property of the gambas version finder as it's not previously set.
Online now: No Back to the top

Post

Posted
Rating:
#14
Guru
BruceSteers is in the usergroup ‘Guru’
a few updates / fixes

now there's mount all button

the system release info command needed to be improved to handle soft links
Copy and paste this into the command to change it…

<HIGHLIGHT highlight="shell">
#!/usr/bin/env bash

ROOT='$(ROOT)/etc'
cd "$ROOT"
echo "checking '$ROOT'"

CheckInfo() {

PTH="$1"
if [ -e "$PTH" ]; then
  R=$(ls -l "$PTH");
  if "$R" == *"> "* ; then
   echo -n "$PTH (link) "
   PTH="${R#*> }"
   if "$PTH" == "../"* ; then
     PTH=${PTH//../${ROOT%/*}}
   else
     PTH="$(ROOT)$PTH"
   fi
   
  fi
  echo -e "$PTH"; cat "$PTH"; echo
fi
}

CheckInfo "./upstream-release/lsb-release"
CheckInfo "./lsb-release"
CheckInfo "./upstream-release/os-release"
CheckInfo "./os-release"
</HIGHLIGHT>

New version in first post
Online now: No Back to the top

Post

Posted
Rating:
#15
Guru
BruceSteers is in the usergroup ‘Guru’
More visual customization.

Now you can edit the main gridview columns to give all the info you need right away. :)
Image

(Click to enlarge)


On the commands page there is now a List Items tab for managing the gridview.
You can add/remove items
You can set the header text.
You can use the StoredData info in the item.
The text you set can be run as a shell command.
Image

(Click to enlarge)



I have also enabled drag-n-drop on the Command MenuView control.

Uploaded new version 1.2.5 to first post
Online now: No Back to the top
1 guest and 0 members have just viewed this.