Some suggestions for making VBox better

Here you can provide suggestions on how to improve the product, website, etc.
Post Reply
NKTUD
Posts: 4
Joined: 27. Sep 2019, 21:32

Some suggestions for making VBox better

Post by NKTUD »

VirtualBox is a great piece of software that I use nearly daily. But I have a few suggestions to make it even better, more user-friendly and easier to use. Also, I believe those changes are relatively easy to implement, though I myself cannot do that.

- Automated installations.
In VMWare, you can insert an ISO file at the creation of a new VM, and VMWare will automatically detect which OS the ISO contains, e.g. Windows XP. Then, for lots of these OSs (especially Windows-OSes), you can choose an automated setup.
For XP, for example, this creates a floppy drive with a WINNT.SIF on it and inserts it into drive A:. The Setup will automatically check if such a file is present and if so, use it for the installation. This file contains stuff like the network name, the product key and so on. An example file could look like this:

Code: Select all

;SetupMgrTag
[Data]
    AutoPartition=1
    MsDosInitiated="0"
    UnattendedInstall="Yes"

[Unattended]
    UnattendMode=FullUnattended
    OemSkipEula=Yes
    OemPreinstall=No
    TargetPath=\WINDOWS
    UnattendSwitch=Yes
    WaitForReboot="No"
    AutoActivate="No"
    Repartition="Yes"

[GuiUnattended]
    AdminPassword="INSERTPASSWORDHERE"
    EncryptedAdminPassword=NO
    OEMSkipRegional=1
    TimeZone=LOCALTIMEZONE
    OemSkipWelcome=1

[UserData]
    ProductKey=FCKGW-ABCDE-FGIJK-LMNOP-QRSTU
    FullName="Local username"
    OrgName="Local organization name"
    ComputerName=VBoxMachineName
[GuiRunOnce]
    D:\setup.exe /automatedinstall
In VMWare, you can enter some of these information and then do not have to intervene once the VM starts. The GuiRunOnce allows to automatically install the VirtualBox tools. Also, it's way easier to insert something into the GUI of VBox (e.g. via copy&paste) than to manually type things like the product key.

A great addition to this would be to be able to save certain configurations for later setups of the same OS. Since this practically only needs to create a text file on a virtual floppy, I believe this to be technically quite easy to realize, though having a great advantage in everyday usage.

This example was for Windows XP, but I strongly believe it's as simple or even simpler for other Versions of Windows.

- Automatically detect the OS from the ISO

This is a bit trickier, especially for Linux. But for Windows, you can look into the ISO and look for D:\setup.exe and check the file version of it. If it is 5.1.2600.XXXX, it's XP, if its 6.0.600X.XXXXXX, it's Vista and so on. This is language independent, too. It's more a heuristical approach that might fail (in Windows Codename "Neptune", a cancelled Beta-version of Windows, which has 5.5.5111 in it's only leaked build, this might fail, but it will work most of the time, like the heuristic checking for "Win... XP" in the machine's name).

- Seamless mode

In VMWare, I remember seeing a "seamless mode" for Windows on Linux hosts. It allows the windows to be drawn as if they were running on the host OS, but still they run on the guest OS in reality. This is surely hard to implement (and maybe I've missed that VirtualBox already has this feature, and if so, I'm sorry for that). But it would a great addon.

- A tab interface

Again a kind of simple addition would be to allow guests to run in tabs instead of seperate windows. Also, it would be great to be able to send a VM to the background (i.e. to "close" the Window of the Guest without shutting it down, or to minimize it to the system tray or something like that). This would be really useful for users having many VMs open at the same time.


As I've said, I'm really enjoying working with VBox. But these details would, in my eyes, make it even more useful, and I believe most of them are relatively simple to implement for anyone familiar with the source of VBox.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Some suggestions for making VBox better

Post by mpack »

Seamless mode is already implemented. Search the user manual.

As to tabbed mode - the devs don't really enjoy being asked to ape VMWare. You would have to give a justification for this feature request, preferably in financial terms, i.e. additional licenses sold.

I recently installed a VMWare XP VM, and I don't remember it being automated. AFAIR I saw the standard XP install dialogs that you would see on any PC. VirtualBox does have a wizard feature to create a VM with minimal user interaction, prompting you for the ISO, but this feature is turned off if you dig into the settings dialogs, implying that you don't need your hand held.

You might want to search for "unattended" in the user manual in case that is what you were referring to.
NKTUD
Posts: 4
Joined: 27. Sep 2019, 21:32

Re: Some suggestions for making VBox better

Post by NKTUD »

I'm not implying VBox to "ape" VMWare, I just find some features very useful and therefore I believe others would find them useful, too.

The phenomenological way of seeing these things ("as they appear" to the end-user) I believe will in the long-term strongly influence the selling of licenses, because it makes the software way easier to use and more comfortable. Comfort is everything in the computer world. It has to be fast and easy to use, otherwise, people will switch to software that is fast and easy to use, and especially in companies, this is true, since a few hundred dollars for VMWare is nothing compared to the time spent uselessly in tinkering with details that could be easily automated. That's why people still use Windows, at all. It's easier to use, you don't need to tinker with it at all to get it working (instead of, e.g. the extreme, Gentoo, which barely works at all without lots of work). For software, it's the cumulation small things that matter a lot.

I obviously know about the ability to do unattended installations, but this still requires much more manual work than necessary, especially since creating unattended installations is quite easy technically (creating a text file on a FAT16-formatted IMG file and mount it in A:\). Even if it just asks for the product key and it can be inserted via copy&paste without seperating at dashes first, this would hugely impact the easiness of installation Windows. Just inserting the ISO file, letting VBox know automatically which OS it is (based on version numbers instead of VM names only) and create the floppy with a product key makes the hassle of installing Windows a lot easier with barely any effort on the programmer's side.

You could even create an IMG file containing the VBox-Additions, so that you can just let the installer do it's thing and then call A:\setup.exe or something like that in the WINNT.SIF after the setup. You're not bound to 1,44MB in IMG files. This way, the setup could be completely automated and unattended.

I know companies that, for saving a few minutes at every installment of Windows in A VM, buy VMWare, just for the ease of it. This is unneccessary and the comfort drives people away from free software solutions like VBox.
NKTUD
Posts: 4
Joined: 27. Sep 2019, 21:32

Re: Some suggestions for making VBox better

Post by NKTUD »

Just as a proof of concept, I wrote a Perl-script for Linux that does the job:

Code: Select all

#!/usr/bin/perl

use strict;
use warnings;

my %options = (
        debug => 0,
        img => undef,
        prodkey => undef,
        password => undef
);

analyze_args(@ARGV);

sub debug (@) {
        if($options{debug}) {
                foreach (@_) {
                        warn "DEBUG: $_\n";
                }
        }
}



main();

sub main {
        debug "main()";
        die "No IMG file! Specify --img=path/to/img/file.img" unless $options{img};
        die "No product key! Specify --prodkey=ABCDE-FGHIJ-KLMNO-PQRST-UVWXY" unless $options{prodkey};

        my $tmpdir = get_tmp_dir();
        my $winnt_sif = create_winnt_sif();
        my $winnt_sif_path = "$tmpdir/winnt.sif";

        write_file($winnt_sif_path, $winnt_sif);
        create_img_file_fat($winnt_sif_path);
}

sub create_img_file_fat {
        my $winnt_sif_path = shift;
        debug "create_img_file_fat($winnt_sif_path)";
        my $create_empty_img_file = 'dd if=/dev/zero of='.$options{img}.' count=1440 bs=1k';
        system($create_empty_img_file);

        my $format_img_fat = '/sbin/mkfs.msdos '.$options{img};
        system($format_img_fat);

        my $copy_winnt_sif = 'mcopy -i '.$options{img}.' '.$winnt_sif_path.' ::/';
        system($copy_winnt_sif);
}

sub write_file {
        my $path = shift;
        my $contents = shift;

        open my $fh, '>', $path or die $!;
        print $fh $contents;
        close $fh;
}

sub get_tmp_dir {
        debug "get_tmp_dir()";
        my $tmp = '/tmp/';

        my $rand = rand();

        while (-d "$tmp$rand") {
                $rand = rand();
        }

        debug "Got $tmp$rand";
        mkdir "$tmp$rand" or die $!;

        return "$tmp$rand";
}

sub create_winnt_sif {
        debug "create_winnt_sif()";
        my $winnt_sif = qq#;SetupMgrTag
[Data]
    AutoPartition=1
    MsDosInitiated="0"
    UnattendedInstall="Yes"

[Unattended]
    UnattendMode=FullUnattended
    OemSkipEula=Yes
    OemPreinstall=No
    TargetPath=\\WINDOWS
    UnattendSwitch=Yes
    WaitForReboot="No"
    AutoActivate="No"
    Repartition="Yes"

[GuiUnattended]
#.($options{password} ? 
    qq#    AdminPassword="$options{password}"\n# : '').
qq#    EncryptedAdminPassword=NO
    OEMSkipRegional=1
    TimeZone=LOCALTIMEZONE
    OemSkipWelcome=1

[UserData]
    ProductKey=$options{prodkey}
    FullName="Local username"
    OrgName="Local organization name"
    ComputerName=VBoxMachineName
[GuiRunOnce]
    A:\\setup.exe /automatedinstall
#;
        return $winnt_sif;
}

sub analyze_args {
        my @args = @_;

        foreach (@args) {
                if($_ eq '--debug') {
                        $options{debug} = 1;
                } elsif (/^--img=(.*)$/) {
                        $options{img} = $1;
                } elsif (/^--prodkey=((?:[A-Z0-9]-?)*)$/) {
                        $options{prodkey} = $1;
                } elsif (/^--password=(.*)$/) {
                        $options{password} = $1;
                } else {
                        die "Unknown command switch `$_`";
                }
        }
}
You can call it with

Code: Select all

perl floppy.pl --img=file.img --prodkey=ABCDEF-GHIJK-LMNOP-QRSTU-VWXYZ --password=test12345 --debug
and it creates a unattended floppy file that installs with the key ABCDEF-GHIJK-LMNOP-QRSTU-VWXYZ and the root password test12345. This then only needs to mounted to A:\ to complete the install unattendly.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Some suggestions for making VBox better

Post by socratis »

NKTUD wrote:I obviously know about the ability to do unattended installations
Hmm... not so sure about that. Have you tried it? Because there's already a "win_nt5_unattended.sif" in the "UnattendedTemplates" VirtualBox subdirectory and it seems to cover a lot more cases compared to your script.
NKTUD wrote:but this still requires much more manual work than necessary
Entering the options in the command line is "much more manual work than necessary"? As in following the options in VBoxManage unattended? If you want to script your installations, I don't think it's too much to ask a user to define several parameters in the command-line. See also Unattended Guest Installation and An Example of Unattended Guest Installation.

Sure, there's no clicky-clicky GUI for this, but that shouldn't affect the 99.99% of the users. There aren't that many people that are doing unattended installations, and you got to consider the gains vs. the pains factor...
NKTUD wrote:Also, it would be great to be able to send a VM to the background (i.e. to "close" the Window of the Guest without shutting it down, or to minimize it to the system tray or something like that).
Have you tried the "Detachable" mode? That's exactly what it does...

As for the rest of your comments, as 'mpack' said, seamless has been around for ages, and IMHO tabbed interface sucks big time, if ever that thing got implemented I would cry "Murder!" :)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply