My Seemless Linux Desktop using VirtualBox, Vagrant, MobaXterm and TotalCommander
Years ago I played around with VMWare Unity Mode in VMWare player or VirtualBox’s Seemless mode. In those modes you start an application on your virtual machine, but the windows appear as running on your host system. Back in the days I ran OpenSuse on my laptop, and had Windows XP or 7 on a Virtual Machine for those cases I had to run PowerPoint.
I wasn’t too enthousiastic about those modes. Of the two I found that VMWare implemented it the most transparent. But it was quite hard to work with multiple screens, and to start the applications using the embedded menu. Now, I didn’t use this in a long time, so it might have been improved. But, for several years already I work with my VM’s (mostly Oracle Linux) using Vagrant most of the time. And I use MobaXterm to connect with them and to start my tools from MobaXterm.
With the XWindows Server in MobaXterm, working with either SQLDeveloper, JDeveloper, or VS Code is very convenient. And it will allow me to cleanup even my local installments of SQLDeveloper or JDeveloper.
So, I have been looking for automating some startup and working on the most convenient setup for me. And I found it (for now) in the combination of:
- VirtualBox
- Vagrant
- MobaXTerm
- And my All time favorite cockpit: TotalCommander
Let’s go through them.
VirtualBox
It must have been around 2003 that I got introduced into VMWare Workstation by my former colleague Robert. It was an eyeopener to see that you could run multiple PCs on your laptop, separating different versions of Oracle Products that could even ‘talk’ to eachother!
Since all is saved in a folder of files, I could do one install and share it with colleagues.
Since Oracle acquired VirtualBox, and because of several direction-changes at VMWare (introduction and revocation of VMWare Server, VMWare player that couldn’t create VMs and then it could, and then it couldn’t anymore,…), after a while it made sense to me to switch to VirtualBox completely. There was a period of time that I had both on my laptop.
So, for me it is only VirtualBox now and we have come to version 6.0.4 at time of writing. Downloadable from the VirtualBox Download Page. Choose the download for your platform. Installing follows the familiar NNF-Pattern ( Next-Next-Finish). And don’t forget to download and install the Platform independent Extension Pack. I guess this is piece of cake for you followers.
Vagrant
Several years ago, I transferred my main installations to a Vagrant project and it’s still work in progress.
Vagrant allows me to automate the creation and provisioning of my VM’s. Relieving me from the need to keep multiple VMs up to date. Sharing can is much simpler.
Starting up and eventual provisioning of a box is simple: just issue the vagrant up command in the folder with the vagrant file is all you have to do. Suspending a box is done using vagrant suspend.
My respected con-colleague Maarten Smeets wrote quite a bit about Vagrant and lately about a few good tips.
Vagrant has reached version 2.4.1 recently and can be downloaded here. It also follows the famous NNF(Next-Next-Finish)-pattern. But although it allows you to choose the install directory, it is very devoted to be installed in the c:\HashiCorp\Vagrant\. I quit trying to force it elsewhere.
Over the years I developed my vagrant project, into the current version that I published on github/makker-nl/vagrant, sub-project: ol8_develop.
MobaXterm
Many of my even respected coworkers stick with their all-time favorite Putty. Putty stays ubiquitous. It is simple, but I always have found it a bit archaic. I thought I once noticed that the support was terminated. However, just now they just released the stunning version number of 0.81. I don’t mean to be sarcastic, and Putty has it’s own right of existence. But give MobaXterm a try. It’s loaded with nice features, including an SCP client that can follow your SSH session. And as said, also an XWindows Server. So, connect with ssh to your Linux server and run jmc, visualVM, Oracle Universal Installer, Weblogic Configurator, JDeveloper, SQLDeveloper, etc. etc. and the UI will pop-up on your desktop. Also MobaXterm includes cygwin so you’re able to run a terminal session on Windows. It even allows you to do ps -ef to show your running windows apps!
I also discovered the really easy UI to create an SSH-tunnel with MobaXterm!
You can download it here, in a portable and an installer version. I choose the portable. The free edition includes games (why?) and a limit number of sessions, macros and tunnels. But the professional edition only costs a few bucks/euros.
TotalCommander
Ever since the introduction of Windows ’95, I disliked the Windows Explorer. Luckily I soon discovered Windows Commander, under pressure of Microsoft, renamed to Total Commander. And it’s even a better name, because it’s about the second tool I install on a new Windows Desktop. Just after Firefox, to be able to close IE/Edge…
It’s my cockpit, allows me to navigate to hot folders quickly, introspect files, navigate through archives, edit them or unpack them, multi-rename files, compare files, etc., etc. I just don’t make coffee with it. One of the nice features is the button bar, where you can launch applications. And this is the thing I use for this blog.
Tie it all together
I realize that I overloaded you with sales talk about my favorite tools.
After installing all the tools and having your Vagrant project in place all can be tied together.
I have a project that provisions a VM with an Oracle Database, SQLDeveloper, SOASuite, and BPM QuickStart.
My TotalCommander Toolbar looks like:
You can right-click anywhere in the toolbar to edit it, create new buttons. A ‘button’ that is left empty (no command) is presented as a separation bar.
Startup & suspend the VM
Let’s take a look at the Vagrant SOA Start button:
It’s simple: the command is vagrant up and important here is that it should be executed in the folder where the vagrant file resides. I provide a tool tip, and I created an icon file from the Vagrant Logo using my favorite image app IrfanView.
Clicking the button will fire up the VM and potentially provision it. I copied the button to create a button to suspend the VM. The command there is vagrant suspend. But for the rest it is exactly the same.
MobaXterm local terminal
When you start MobaXterm you’ll get to:
When you click on the ‘Start local terminal’ button, you get a shell window running in the user home folder that is presented by the tool:
You can ssh to a remote server from this terminal. Of course you can create a session to a remote server. Doing so for the first time, logging on to the particular user, allows you to save the password for that user. I’ve already done that, and then I can do a ssh oracle without the need to provide a password.
Start SQLDeveloper and JDeveloper (SOA QuickStart)
To start an application you can just invoke MobaXterm with the -newtab parameter. Then between quotes, you can add a shell-snippet. In this case I wait for the XServer to be started. And use ssh to connect to the VM. Vagrant initiates an SSH-tunnel listening on port 2222. Then start the tool using the script in the home of the installation:
-newtab "waitforX; echo Start SQLDeveloper;nohup ssh oracle@localhost -p 2222 /app/oracle/product/sqldeveloper/sqldeveloper.sh> sqldeveloper.out 2>&1 &"
To have this working, you should connect once with a regular MobaXterm session to the VM using the oracle user. This is to store the credentials in MobaXterms keystore.
Similarly, I have a button to start JDeveloper, VS Code,the Nautilus Linux/Gnome file manager, and other tools. And it all ends up in the following desktop:
It might need some tweeking here and there. But for now I love it and it works like a charm.
Originally published at http://blog.darwin-it.nl.