Chapter 10. Troubleshooting Minishift
10.1. Troubleshooting Overview
This section contains solutions to common problems that you might encounter while using Minishift.
10.2. Special Characters Cause Passwords to Fail
Depending on your operating system and shell environment, certain special characters can trigger variable interpolation and therefore cause passwords to fail.
Workaround: When creating and entering passwords, wrap the string with single quotes in the following format: '<password>'
10.3. Undefining virsh Snapshots Fail
If you use virsh
on KVM/libvirt to create snapshots in your development workflow, and then use minishift delete
to delete the snapshots along with the VM, you might encounter the following error:
~]$ minishift delete
Deleting the Minishift VM...
Error deleting the VM: [Code-55] [Domain-10] Requested operation is not valid: cannot delete inactive domain with 4 snapshots
Cause: The snapshots are stored in ~/.minishift/machines
, but the definitions are stored in var/lib/libvirt/qemu/snapshot/minishift
.
Workaround: To delete the snapshots you need to perform the following steps.
Delete the definitions.
~]$ sudo virsh snapshot-delete --metadata minishift <snapshot-name>
Undefine the Minishift domain.
~]$ sudo virsh undefine minishift
Delete the VM and restart Minishift.
~]$ minishift delete
In case the above steps do not resolve the issue, you can also use the following command to delete the snapshots:
~]$ rm -rf ~/.minishift/machines
It is recommended to avoid using metadata when you create snapshots. To make sure of this, you can specify the --no-metadata
flag. For example:
~]$ sudo virsh snapshot-create-as --domain vm1 overlay1 \ --diskspec vda,file=/export/overlay1.qcow2 \ --disk-only --atomic --no-metadata
10.4. KVM: Error creating new host: dial tcp: missing address
The problem is likely that the libvirtd
service is not running. You can check this with the following command:
~]$ systemctl status libvirtd
If libvirtd
is not running, start it and enable it to start on boot:
~]$ systemctl start libvirtd ~]$ systemctl enable libvirtd
10.5. KVM: Failed to connect socket to '/var/run/libvirt/virtlogd-sock'
The problem is likely that the virtlogd
service is not running. You can check this with the following command:
~]$ systemctl status virtlogd
If virtlogd
is not running, start it and enable it to start on boot:
~]$ systemctl start virtlogd ~]$ systemctl enable virtlogd
10.6. KVM: Domain 'minishift' already exists…
If you try minishift start
and hit the above error, ensure that you use minishift delete
to delete the VMs created earlier by you. However if this fails and you wish to completely clean up Minishift and start fresh do the following:
Check if any existing Minishift VM are running:
~]$ sudo virsh list --all
If any Minishift VM is running, stop it:
~]$ sudo virsh destroy minishift
Delete the VM:
~]$ sudo virsh undefine minishift
Delete the
.minishift/machines
directory using:~]$ rm -rf ~/.minishift/machines
In case all of this fails, you may want to uninstall Minishift and do a fresh install of Minishift.
10.7. xhyve: Could not create vmnet interface
The problem is likely that the xhyve driver is not able to clean up vmnet
when a VM is removed. vmnet.framework
determines the IP address based on the following files:
-
/var/db/dhcpd_leases
-
/Library/Preferences/SystemConfiguration/com.apple.vmnet.plist
Reset the minishift
IP database, make sure to remove the minishift
entry section from the dhcpd_leases
file, and reboot your system.
/var/db/dhcpd_leases section for minishift. The highlighted line identifies the section.
{
ip_address=192.168.64.2
hw_address=1,2:51:8:22:87:a6
identifier=1,2:51:8:22:87:a6
lease=0x585e6e70
name=minishift
}
You can completely reset the IP database by removing the files manually but this is very risky.
10.8. VirtualBox: Error machine does not exist
If you use Microsoft Windows, make sure that you set the --vm-driver virtualbox
flag in the minishift start
command. Alternatively, the problem might be an outdated version of VirtualBox.
To avoid this issue, it is recommended to use VirtualBox 5.1.12 or later.
10.9. Hyper-V: Hyper-V commands must be run as an Administrator
If you run Minishift with Hyper-V on Microsoft Windows as a normal user or as a user with Administrator privileges, you will encounter the following error:
Error starting the VM: Error creating the VM. Error with pre-create check: "Hyper-V commands must be run as an Administrator".
Workaround: To overcome this error you can either add yourself to the Hyper-V Administrators group, which is recommended, or run the shell in an elevated mode.
If use PowerShell, you can add yourself to the Hyper-V Administrators group as follows:
As an administrator run the following command:
([adsi]”WinNT://./Hyper-V Administrators,group”).Add(“WinNT://$env:UserDomain/$env:Username,user”)
- Log off and log in for the change to take effect.
You can also use the GUI to add yourself to the Hyper-V Administrators group as follows:
- Click the Start button and choose Computer Management.
- In the Computer Management window, select Local Users And Groups and then double click on Groups.
- Double click on the Hyper-V Administrators group, the Hyper-V Administrators Properties dialog box is displayed.
- Add your account to the Hyper-V Administrators group and log off and log in for the change to take effect.
Now you can run the Hyper-V commands as a normal user.
For more options for Hyper-V see creating Hyper-V administrators local group.