Creating a custom UI for VBox the fast way - Whonix Windows GUI

Good day,

so as you may or may not have seen, in this thread there has already been a bit of a discussion on whether there should be a “special GUI” to make VBox simpler for beginners: [archived] Previous, now Deprecated Whonix Windows Installer - #36 by Patrick

Now, this may seem as something complex, though it isn’t. In fact, depending on your definition, this may be done in less than two minutes.

The shortcut method:

This by all definitions isn’t really a GUI by any stretch of the imaginable, though what this will give us are two icons (one for the Gateway, one for the Workstation) which start Whonix when double clicking on them.

1.) Right click on for example the desktop and select New → Shortcut. Then, click on browse and look for a file named “VBoxManage.exe”, it should be located in the folder VirtualBox was installed to.

2.) Now, type the following after the quotation marks:

startvm Gateway

This is assuming your Gateway is called “Gateway”.

3.) Right click on the newly made shortcut, go to the “Shortcut tab” and set “Minimized” under "Run.

Now, repeat this procedure for the Workstation and voila, simply click on those two shortcuts and both the Gateway and the Workstation start in their windows. Nothing needed.

The “real” method (theory):

Building on “vboxmanage.exe”, it will be quite easy to create a real GUI with an additional button for an advanced mode and more features using C++ or another basic programming language. I’ll attempt something like this in the near future.

If the GUI is in any way presentable, it could be bundled with the installer which is currently worked on, to make the “Whonix-experience” that much better.

Have a nice day,

Ego

The shortcut method is cheap and simple. Good enough for an initial implementation. Makes the user “see something” a bit quicker. Later they can still figure out “full” VirtualBox. Overall I think this would improve the first time experience. Maybe just one shortcut, that is a batch file, that starts both virtual machines at once. All integrates well with the Windows installer.

The real method is still worthwhile as second iteration. Perhaps a tabbed interface.

Good day,

did work on that parallel to the installer. Actually took about 5min. Here is the entire code for anyone interested:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;


namespace Whonix_GUI
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string a;
            a = "/K VBoxManage startvm Whonix_Workstation";
            System.Diagnostics.Process.Start("CMD.exe", a);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            string b;
            b = "/K VBoxManage startvm Whonix_Gateway";
            System.Diagnostics.Process.Start("CMD.exe", b);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("VirtualBox.exe");
        }
    }
}

This, as you may have noticed, pressumes that you’ve named your gateway “Whonix_Gateway” and your workstation “Whonix_Workstation”. Change this, according to what you namend yours. To use this, simply create a C#-Form in VisualStudio (any version since 1.0 should suffice) and create a GUI with the corresponding buttons, like this fairly awfull one:

Then, simply publish the project and put your “creation” in the same folder your VBoxManage.exe is, link to it on your desktop and voilá, you’ve got a simple GUI of your very own. I made it in such a way, that, by pressing the matching Gateway and Workstation buttons, each of them should start. The “Advanced button” simply calls the “normal” GUI provided with VirtualBox. At the moment, the GW and WS buttons sadly can only start it, though that is something I’ll solve in the next days.

Have a nice day,

Ego

1 Like