How to debug, troubleshoot, and fix common VM issues on Windows, Mac, and Linux?
First published: Friday, February 28, 2025 | Last updated: Friday, February 28, 2025Fix common VM issues with proper debugging and troubleshooting when using VirtualBox, VMware Fusion, and Vagrant in Windows, Mac, or Linux operating systems.
VM booting issues, errors, and solutions
VirtualBox + Vagrant: Unexpected VM termination on boot or startup
Error
This type of VM boot error commonly arises on the Windows operating system due to changes or incompatibilities introduced by the Windows update.
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr are shown below.
Command: ["startvm", "5e1a7b03-961e-44d4-9f78-b5cd392ea450", "--type", "headless"]
Stderr: VBoxManage.exe: error: The virtual machine 'sloopstash-ubuntu-linux-18-04-server' has terminated unexpectedly during startup with exit code 1 (0x1). More details may be available in 'C:\Users\tuto\VirtualBox VMs\sloopstash-ubuntu-linux-18-04-server\Logs\VBoxHardening.log'
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, interface IMachine
Solution
Upgrade VirtualBox and Vagrant to the latest versions to avoid compatibility issues. Keeping VirtualBox updated is crucial for avoiding boot failures and optimizing virtual machine performance.
VirtualBox + Vagrant: VM boot failure due to timeout
Error
The error described occurs when the VM fails to boot within the specified timeout period, leading Vagrant to abort the process. This issue can sometimes result from network misconfiguration, which prevents SSH login. Additionally, it can occur if the CPU cores are overloaded.
Bringing machine 'sloopstash-ubuntu-linux-18-04-server' up with 'virtualbox' provider...
==> sloopstash-ubuntu-linux-18-04-server: Booting VM...
==> sloopstash-ubuntu-linux-18-04-server: Waiting for machine to boot. This may take a few minutes...
Timed out while waiting for the machine to boot.
Solution
- Increase the
config.vm.boot_timeout
parameter in the Vagrant configuration (Vagrantfile). - Disable any antivirus software currently running on the host machine.
- Check the VM’s network settings and attempt to SSH into the VM for additional troubleshooting.
- Ensure that the system has enough CPU cores and is not under heavy load.
- Open the VirtualBox GUI to verify that the operating system boots correctly within the VM.
- Finally, restart the VM using Vagrant CLI.
VM networking issues, errors, and solutions
VirtualBox + Vagrant: Host-only network adapter failure
Error
The error occurs due to network misconfiguration or a missing driver in VirtualBox, as the host-only adapter prevents the VM from connecting to the correct network.
VBoxManage.exe: error: Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #3' (VERR_INTNET_FLT_IF_NOT_FOUND).
VBoxManage.exe: error: Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND)
Solution
- Open Windows Network Connections.
- Right-click on VirtualBox Host-Only Adapter.
- Select Properties.
- Ensure the VirtualBox NDIS6 Bridged Networking Driver is checked.
- Disable and re-enable the adapter.
- Retry launching the VM.
If the issue persists, reinstall VirtualBox or reset the adapter from VirtualBox’s Host Network Manager settings.
VirtualBox + Vagrant: Unable to resolve hostname or domain
Error
This error occurs when the VM cannot resolve hostname or domain due to a local DNS server misconfiguration inside the VM. Sometimes this issue can happen because of network adapter misconfiguration.
Err:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 binutils-common
Temporary failure resolving 'archive.ubuntu.com'
Solution
Modify the DNS resolver configuration file with the correct nameserver parameter. Typically, we set the Google DNS server IP address as the nameserver to fix this issue.
# Modify DNS resolver configuration.
$ echo nameserver 8.8.8.8 | sudo tee /etc/resolv.conf
Conclusion
These troubleshooting steps should help resolve common VM issues related to networking, boot failures, and performance. Keeping all tools updated and ensuring meticulous network configuration will provide a smoother virtual machine experience.