Offering great convenience and security, virtual machines are a must-have for those who like to tinker around and experiment with different operating systems. As personal computers become more and more efficient, the market for virtual machines has grown with them. Today, PCs can run multiple operating systems simultaneously.
The current generation of smartphones have become capable devices. Users can edit videos, play complex high-resolution games, stream and watch 4K videos, and emulate software for computers. This begs the question: can you run a virtual machine on a smartphone?
Can smartphones run a virtual machine?
The short answer is yes. In fact, every smartphone runs on some sort of virtual machine. Currently, Android smartphones work via ART (Android Runtime). This allows bytecodes in APK files to be translated into binary code, which a processor can read and execute. Since the implementation of ART, Android devices with two gigabytes of RAM (or more) could easily run a virtual machine.
2GB of RAM has been around for years, and most modern smartphones are released with more. So, running a virtual machine on a smartphone is much easier than ever.
What apps do I need to run a virtual machine on my smartphone?
To run a virtual machine on your smartphone, you will need to install two apps through Google Play.
Andronix is one of the easiest ways to run a virtual machine on your Android smartphone. The app provides you with all the tools and instructions. It also provides you with copies of the code needed to install the operating system. Andronix is partially open source and currently provides users with several popular Linux distributions for free.
Unless you are comfortable using only a command line interface with your virtual machine, you will need to install a third party application for a GUI (graphical user interface). This is where VNC Viewer comes in. By specifying a local host and providing the correct password (which you determine), VNC Viewer and its RFB (Remote Frame Buffer) protocol will connect to your device and provide a graphical interface.
How to run a virtual machine on a smartphone
Once you’ve downloaded and installed both apps, charge your phone and find a location with a strong Wi-Fi connection before you begin.
1. Open the Andronix app and install Termux
Once the app is open, you will immediately see all the free Linux distributions that you can run on your phone. These distributions include Ubuntu, Kali Linux, Debian, Arch Linux, Manjaro, Fedora, Void, and Alpine.
Access the Termux installation page by tapping the drop-down icon at the top left of your screen. Go to Settings, and swipe down to the end of the page. To select Run the installation of Termux, then select To download. Once downloaded, select Authorize the installation, and you’re done.
2. Install your preferred operating system
In Andronix, go back to the main menu and select the distro you want to use. Once selected, the application will indicate the difficulty of installing the specific distribution and the complications you might encounter.
To select Proceed and install. Andronix will provide you with GUI options: Office environment, Window managers, and CLI only.
If you only want to use your smartphone and need a graphical interface, select Desktop environment. Windows managers will provide you with a graphical interface and keyboard to navigate the window. CLI Only will strictly use a terminal; Only choose this option if you are comfortable with the distribution.
After selecting your GUI, Andronix will provide you with desktop environment options. XFCE is an older lightweight Linux desktop environment; opt for this option only if you wish. LXQT replaced LXDE. If you want the best performance out of the three options, go with LXQT.
Once you have selected your preferred desktop environment, a prompt will appear informing you that an order has been copied to your clipboard. To select Open Termux and paste the command.
The installation will begin at this point. The complete installation will take a little time. Make sure to check your phone every now and then as you will need to specify your location, language, and time. When the installation is almost complete, you will be asked to provide a password. Don’t worry if you type on the keyboard and it doesn’t seem to type, that’s exactly how Linux works.
3. Start the VNC server
On first start, you will find an option on what resolution you want your server to use. Again, experiment and find what you like. The fourth option (HD-ready resolution) is always a good option.
4. View the virtual machine via VNC Viewer
Open VNC Viewer and select the plus icon, which will open a form. On the Address field, input local host: 1. You can enter anything you want for the Last name domain. hurry TO CREATE. You will receive a warning, but you will only have to press OK.
You will then be prompted to enter the password you created earlier. Once you press CONTINUE, you will be in control of your virtual machine with a graphical interface. Enjoy!
How to start the VM and the VNC server
Open the Termux app and use the command ls to view the contents of your current directory.
Use the command ./ (point slash) with the .sh file colored in green and starts with the word To start up. This will start the VM on your phone and assign you as the “root @ localhost” user. You have successfully run the virtual machine on your smartphone. For example, the command below will start an Ubuntu virtual machine.
To start the VNC server, you must use the command server start command.
Properly shut down your server and virtual machine
It is important that you shut down your server and VM properly to save battery power and to avoid any issues that you might encounter if you don’t shut them down properly.
When you exit your VNC viewer, be sure to shut it down like a regular computer. After that go to your terminal and use the command vncserver-stop, then type 1 or the number corresponding to the VNC server you want to close.
To close the VM, just use the command to go out. To exit Termux, also use the exit command.
Based on the many queries on the internet regarding the difficulty of opening a server, many people seem to forget to shut down the VNC server after the initial startup. To avoid all the complicated responses from the Internet, you should shut down the first VNC server that was opened during boot. You can do this by using the vncserver-stop order.
Can you install a virtual machine on an iPhone?
The installation of a virtual machine on an Apple product is possible. However, it may not be as easy as with Android. The best way to do this would be via UTM. UTM is an application that you can use on an Apple device to run other operating systems such as Windows and various Linux distributions.
The great thing about UTM is that you don’t need to jailbreak for iOS 11, 12, 13 and some variants of iOS 14. It is also an open source app that you can personally check out on GitHub. The app is reasonably easy to use, as long as you follow the users Guide.
The problem with UTM is that Apple won’t allow you to install it as a “regular consumer”. Actually, the app is not listed on the App Store. The only way to install UTM on your iPhone is to provide a certificate stating that you are a developer testing an app on the device.
iPhone offers free and paid subscriptions to get a developer certificate. This shouldn’t be a problem if you don’t mind paying the $ 99 for a one-year subscription. But if you want to go the free route, you’ll have to keep asking for new certificates every seven days.
To make free developer certificates more convenient to use, you can install an application called AltStore. The AltStore is also where you can download and install UTM. Besides being an alternative to the AppStore, this app will automatically sign your free developer certificate, so you won’t have to manually request one every seven days.
The future of VM on smartphones
Running a virtual machine on a smartphone has always been a possibility. However, only a few years ago people could finally run a usable virtual machine. Running a watered-down operating system or two today pretty much represents the limits of what phones can do. However, as smartphone manufacturers continue to improve their products, you can be sure that one day smartphones will be able to run full-fledged virtual operating systems with great stability.
What are virtual machines used for? Here are some practical benefits and uses of virtual machines that you can try out right now.
About the Author