In this insightful exploration, we’ll delve into the realm of hypervisors with a special emphasis on VirtualBox. While other alternatives such as Parallels Desktop, VMware Workstation, and Proxmox VE tread similar paths, each brings its own unique nuances. Some delve into more advanced concepts, while others offer a streamlined approach. Notably, several of these alternatives come with associated costs or embrace open-source principles.
Drawing from my personal experiences, this blog post will shine a spotlight on VirtualBox, offering a nuanced perspective on its capabilities and features. Throughout, we’ll unravel related topics that complement and enhance the understanding of this powerful hypervisor. Join me on this journey as we navigate the diverse landscape of virtualization and uncover the distinct advantages that VirtualBox brings to the table.
Theoretical
○ Personal experience
○ So, what was the solution, and how did Virtuabox save the day?
○ What else can VirtualBox do?
○ Internet & web world
○ Is there a difference between today’s dedicated servers by the popular providers?
Practical
○ Dirty hands
■ Let’s start
Personal experience
With a robust 5+ years’ tenure in the IT domain, currently serving as a Senior Technical Consultant for nearly 3+ years, my role revolves around steering product-oriented solutions. Working with a team of +11 engineers, including 8 dedicated developers, our work landscape revolves around harnessing the potential of VirtualBox within our projects.
In the context of our dynamic environment, we rely heavily on Docker and Docker Compose to shape our development landscape. Embracing cutting-edge technologies such as Kubernetes, Terraform, and AWS, our core technology stack centers around PHP, complemented by the robust LEMP stack. Operating within a Windows-centric infrastructure due to our partnership with Microsoft, our journey has been marked by the evolution of our projects.
As our initiatives expanded over time, we faced challenges with container performance, particularly within the growing number of services. Despite progressing toward a successful microservices architecture, the performance between containers became a notable bottleneck affecting overall project efficiency. Seeking solutions within the Docker community, we experimented with disabling Windows Hyper-V and transitioning to subsystem Linux. While this yielded a modest performance boost, it fell short of meeting our needs for replicating staging or production environments.
In our quest for answers, we engaged with the Docker community, sharing our challenges. The resounding response was succinct but illuminating: Docker on Windows, due to inherent compatibility issues, may not be the optimal choice for our specific setup. This realization prompted further exploration and adjustments to our technological landscape, ultimately steering us towards a more tailored and efficient infrastructure for our evolving project requirements.
So, what was the solution and how did Virtuabox save the day?
In our AWS environment, precision is paramount. To align with this principle, we opted for dedicated Ubuntu Linux servers, each tailored to meet the unique memory and performance demands of its corresponding environment. Echoing this strategy locally, we replicated this approach within VirtualBox, fashioning Ubuntu virtual machines that seamlessly integrate with our development workflow.
Armed with our preferred IDE and the dynamic duo of Docker and Docker Compose, our containerized setup delivers on its promise: a smooth, high-performance development experience. Notably, the transition for new team members has become a breeze, thanks to the simplicity of VM import and export. The onboarding ritual involves configuring Git profiles and pulling the latest changes—effortlessly facilitated by our standardized virtual environment.
Consistency reigns supreme in our development ecosystem. Through the use of VM snapshots, every team member enjoys uniformity in CodeStyle formatters, development tools, and even the choice of wallpaper (a touch of humor included!). Accountability extends to individual developers managing their snapshots and cloned VMs in case of unforeseen issues.
A personal favorite feature of VirtualBox is its ability to halt and save the state of a VM. Resuming work the next day feels like picking up right where we left off, with the IDE retaining the selected file and Docker configurations from the previous session—a productivity boon.
While occasional challenges arise, such as the rare occurrence of a corrupted VM, we’ve fortified our defenses with snapshots and a handy troubleshooting reference. The codebase, residing on GitLab, serves as an impervious fortress against the loss of crucial code. Our synchronized commands and Code First Approach, coupled with migrations and seeders, ensure that database repopulation is swift and seamless.
In the dynamic landscape of development, VirtualBox emerges as a cornerstone, empowering our team with a reliable and flexible infrastructure that not only meets but exceeds our expectations.
What else can VirtualBox do?
Before we tackle the question at hand, let’s first acquaint ourselves with VirtualBox. This versatile hypervisor stands as a full virtualizer designed for x86 hardware, with applications spanning server, desktop, and embedded usage. Notably, it distinguishes itself as the sole professional solution available as Open Source Software under the GNU General Public License. Both Solarius OS and VirtualBox share the umbrella of maintenance by Oracle, adding a layer of assurance to their reliability.
With a longstanding presence in the market, VirtualBox has dedicated itself to supporting a diverse array of operating systems for the creation of virtual machines. Its compatibility extends across various host operating systems, encompassing Windows, Mac, Linux, and Solarius. This flexibility lends itself well to a multitude of scenarios, where the most common installations often involve a Windows host running a virtual machine for Linux, or a Mac with an x86 host hosting a virtual machine running Windows. The permutations depend on specific needs, be it testing, development environments, or experimental checks.
Upon delving into the user manual, one discovers an intriguing capability—the option to utilize a created virtual machine as a component of the Oracle Cloud. The manual provides a comprehensive specification, guiding users through a step-by-step integration process. This integration feature not only extends the utility of VirtualBox but also underscores its adaptability to diverse and evolving computing environments.
Creating home workstation
Creating a home workstation with VirtualBox offers a fascinating avenue for crafting a personalized computing environment. Here’s a step-by-step guide to set up your own bare-metal server:
1. **Hardware Assembly:**
Select the computer components that align with your requirements and assemble them to create a bare-metal server. Opt for a Debian-based operating system for optimal performance.
2. **Virtualization with VirtualBox:**
Install VirtualBox on your server to enable the creation and management of virtual machines, accommodating various operating systems such as Windows and Linux distributions.
3. **Network Configuration:**
Connect your bare-metal server to the LAN with an Ethernet cable. Configure your router to allocate a static IP address to the server, ensuring consistent accessibility.
4. **Port Forwarding for VMs:**
If needed, configure port forwarding on the router to direct specific services from the virtual machines (e.g., HTTP on port 80, SSH on port 22) to the server.
5. **Web-Based Management with phpVirtualBox:**
Optionally, enhance your setup by installing phpVirtualBox on the server. This web service facilitates convenient access to all virtual machines through a browser using the static IP address. This feature is particularly useful within a home private network.
6. **Alternative Docker Installation:**
For a streamlined approach, consider installing Docker on your server and deploying the phpVirtualBox image available at https://hub.docker.com/r/jazzdd/phpvirtualbox/.
Now, the question arises about public access. Here are two options:
– **Static IP Address with Router Port Forwarding:**
If your network provider offers a static IP address for your router, you can configure router port forwarding to enable external access to your VirtualBox setup.
– **Dynamic DNS Support:**
Alternatively, you can leverage Dynamic DNS support. Configure your router to support Dynamic DNS, and through port forwarding, enable external access to your VirtualBox environment. This option is particularly useful when your home network’s IP address dynamically changes.
By following these steps, you can transform your home workstation into a versatile and accessible computing hub, whether for personal use or experimentation with various virtualized environments.
Internet & web world
For comprehensive information about VirtualBox, a wealth of resources is available on the internet. Some key documents that provide essential insights include:
– **End Users Documentation:**
Access the end users’ documentation at [VirtualBox End-user Documentation]. This resource is tailored to users seeking practical information and guidance on VirtualBox usage.
– **Technical Documentation:**
Explore the technical documentation, an invaluable resource for users interested in deeper insights into the inner workings of VirtualBox. You can find this documentation at [VirtualBox Technical Documentation].
– **User Manual:**
The user manual serves as a comprehensive guide to VirtualBox, offering detailed instructions and explanations. Navigate through the user manual at [VirtualBox User Manual] to gain a thorough understanding of the features and functionalities.
Additionally, Oracle provides pre-built virtual machines, available for download at [Oracle Developer VM Community Downloads]. These VMs offer a convenient starting point for various development and testing purposes.
By exploring these resources, users can access a wealth of knowledge and documentation, ensuring a robust understanding of VirtualBox and its applications. Whether you’re a novice or an advanced user, these references provide valuable insights to enhance your experience with VirtualBox.
Is there a difference between today’s dedicated servers by the popular providers?
The succinct response is no. I perceive VirtualBox as a viable option for hosting a dedicated server within your personal computer. In the current landscape, VirtualBox serves as an excellent entry point for anyone delving into the realm of virtualization.
However, considering contemporary trends, there’s a notable shift towards cloud solutions. Clients commonly express a preference for cloud-based architectures, while developers lean towards technologies like Docker and Kubernetes for efficient orchestration. Although the fundamental concept of isolation remains, the trend now involves pre-configured projects and image settings, orchestrated within pods—a true gem in the landscape of an engineer’s future.
In this evolving scenario, the emphasis is on efficiency—less memory consumption, simplified setup processes, and leveraging popular platforms like Docker Hub and GitHub for community collaboration. The integration of Docker and Docker Compose, along with the Kubernetes Command Line Interface (CLI), has become a hallmark of modern development practices.
In my own contributions, such as the project found at [https://github.com/sports-match-maker/docker-pnmamhes], I actively engage with these technologies. It’s an exciting space to be in, with the dynamic ecosystem of Docker and Kubernetes offering a rich and flexible environment for development and deployment.
As we navigate the present and future of technology, the landscape is shaped by these contemporary tools and practices. It’s a thrilling prospect to witness their integration into educational programs and lectures, anticipating the pivotal role they will play in shaping the next generation of engineers and developers.
Dirty hands
As an avid supporter of Linux distributions, VirtualBox stands out as an invaluable tool for exploring and comparing different flavors across various distributions. Two key resources that I frequently turn to are:
– [DistroWatch]: A comprehensive platform providing information and statistics on the popularity of different Linux distributions.
– [It’s FOSS YouTube Channel]: A rich source of video content covering various aspects of Linux, offering practical insights and tutorials.
For the sake of efficiency and a hands-on approach, I’ve chosen Ubuntu Server for our VirtualBox installation. Throughout the installation process, we’ll incorporate Docker and Docker Compose into the VM, hosting essential components such as Adminer (a web UI multi-purpose database client), MySQL as the database, and WordPress as the CMS. The Docker setup will be derived from the repository at [https://github.com/starter-nanorocks/wp-dockerized-app], a project I’ve created as a fervent supporter of Free and Open Source Software (FOSS). I look forward to delving into this repository in more detail shortly.
As we progress, we’ll implement port forwarding, configuring the host PC to reflect WordPress on port 8888 (both guest and host), Adminer on port 3306 (both guest and host), and SSH on guest port 22 redirected to host port 222. This setup ensures accessibility and interaction with the services from both within the VM and externally.
To maintain a consistent and static IP address, I’ll configure my router to allocate the necessary IP, enabling any device connected to my private network, such as my phone with a browser, to seamlessly access the WordPress site, Adminer, and establish an SSH connection.
Toward the end of our exploration, we’ll take a snapshot, perform an OS deletion, and create a clone of the VM. This process encapsulates the versatility of VirtualBox, allowing for experimentation, efficient management, and seamless replication of virtual environments.
Let’s start
- Download Ubuntu Server ISO from: https://ubuntu.com/download/server
- Download VirtualBox for your OS: https://www.virtualbox.org/wiki/Downloads
- Install the virtual box and open it
- Click on the Icon new where you will see a wizard
- Add virtual machine name (FINKI) and pick the type of OS (Ubuntu 64bit), pick ISO location, click Next
- Set hardware power ( I will pick 12GB RAM + 3 CPU cores) **It’s not min requested but I have resources. More Info (here) SCREENSHOT_1
- The disk will be 30GB SCREENSHOT_2
- Go next and finish. SCREENSHOT_3
- Double-click on FINKI. It will open a new window where the ISO will need to be installed. SCREENSHOT_4
- We will continue without updates SCREENSHOT_5
- Same for the keyboard SCREENSHOT_6
- Next, we will pick Ubutu Server SCREENSHOT_7
- And defaults for network connections SCREENSHOT_8
- Because there is now a proxy that will be used we will just continue SCREENSHOT_9
- Configuration on Ubuntu achieve mirrors will be default SCREENSHOT_10
- For Storage configuration, we will pick SCREENSHOT_11
- Same for storage configuration SCREENSHOT_12 the prompt will popup and we will continue the process because this is the first time installation.
- For profile setup I will pick the next names and for password secret SCREENSHOT_13
- For the upgrade, we will skip the process for now SCREENSHOT_14
- We will enable SSH setup so latter we can connect SCREENSHOT_15
- Next from the snap list, we will pick docker SCREENSHOT_16
- Now the installation process is started, click reboot now when is finished. SCREENSHOT_17
- Next, you will see the screen for login where you will need to set a login (nanorocks) for the user and password (secret) SCREENSHOT_18
- To have better manipulation over your terminal and to access it from your host PC we will go to the vm finki window in machine > settings > network > port forwarding to enable SSH connection. SCREENSHOT_19
- Now I can close the virtual machine while saving the state SCREENSHOT_20
- I am able to run the VM in headline mode while I am connected from the host terminal. SCREENSHOT_21 SCREENSHOT_22 SCREENSHOT_23
- Now let’s generate a new ssh-key and place it inside my GitHub profile SCREENSHOT_24 SCREENSHOT_25
- Now let’s check we have docker, docker-composer, and git SCREENSHOT_26
- Now we can clone the repository and write in the terminal writing git clone git@github.com:starter-nanorocks/wp-dockerized-app.git SCREENSHOT_27
- The repo will be downloaded and we can do `cd` inside the project SCREENSHOT_28
- Now we can run the commands from the README.md SCREENSHOT_29
- Now all the containers are started and we need to do port forwarding for wordpress and adminer. SCREENSHOT_30
- Access from host machine SCREENSHOT_31
- Setup router for static IP address SCREENSHOT_32
- Mobile phone access the host IP address with ports SCREENSHOT_33 SCREENSHOT_34
- Now, we will stop the VM with the saved state and make a clone of it. SCREENSHOT_35
- We will clone all network adapters and we will do a full clone
- While the FINKI VM is halted we will check again the ssh access, WordPress and admirer
- As we can see everything is working as expected as we have in the FINKI VM SCREENSHOT_36 SCREENSHOT_37
- We will halt the VM
- We will create a snapshot on FINKI VM, we will try to delete the entire system (https://superuser.com/questions/313804/how-to-delete-entire-system-using-terminal), and restore the created snapshot SCREENSHOT_38 SCREENSHOT_39 SCREENSHOT_40
- We will continue with creating new snapshots for the current state.
- As it was expected the entire OS is restored and we can log in with ssh, check the WordPress and adminer.
Last words
VirtualBox stands out as a versatile and user-friendly hypervisor solution, demonstrating its prowess in addressing real-world challenges through a combination of practical insights and theoretical exploration.
As a general-purpose virtualizer, VirtualBox showcases compatibility with a diverse range of operating systems, extending its reach to cloud platforms such as Oracle Cloud. The practical application of VirtualBox was illuminated through a hands-on guide, showcasing the seamless setup of an Ubuntu Server, deployment of Dockerized applications, and strategic use of snapshots for robust backup and recovery processes.
The user-friendly interface, cross-platform compatibility, and the robust functionality of snapshots position VirtualBox as a valuable asset for developers, administrators, and enthusiasts alike. Its ability to bridge the gap between traditional virtualization and modern, cloud-centric techniques further underscores its significance in the dynamic landscape of technology.
VirtualBox emerges as a powerful tool that continues to showcase its dependability in generating applications for development, testing, and educational purposes. Its adaptability and comprehensive feature set make it a preferred choice for those seeking a reliable and efficient virtualization solution. As technology evolves, VirtualBox remains at the forefront, demonstrating its enduring relevance in meeting the diverse needs of users across different domains.