使用VirtualBox创建VM及Rancher服务器时出现错误求助
Hey there, let's work through those VirtualBox VM and Rancher server errors you're hitting on Ubuntu 17.04. I’ve dealt with similar hiccups using older VirtualBox versions on this Ubuntu release, so here are some practical fixes to try:
1. Fixing VirtualBox VM Creation Issues
Enable Virtualization Extensions in BIOS/UEFI
Most laptops ship with virtualization disabled by default. Reboot your machine, enter BIOS/UEFI (usually via F2, Del, or Esc during boot), and look for options like Intel VT-x or AMD-V. Make sure these are enabled—this is non-negotiable for VirtualBox to run VMs properly.Clean Reinstall VirtualBox with Proper Dependencies
Old VirtualBox 5.1/5.2 installs might be corrupted or missing critical system libraries. First, purge the old versions:sudo apt purge virtualbox-5.1 virtualbox-5.2 sudo apt autoremove && sudo apt autocleanThen install the latest compatible version for Ubuntu 17.04 (VirtualBox 5.2 is the last officially supported build for this release) with the correct repository:
echo "deb [arch=amd64] https://download.virtualbox.org/virtualbox/deb zesty contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - sudo apt update && sudo apt install virtualbox-5.2 linux-headers-$(uname -r) build-essential dkmsFinally, rebuild the kernel modules to avoid compatibility issues:
sudo /sbin/vboxconfigFix User Group Permissions
Your user might not have access to VirtualBox's resources. Add yourself to thevboxusersgroup, then log out and back in:sudo usermod -aG vboxusers $USER
2. Fixing Rancher Server Creation Issues
Rancher often relies on Docker and proper network configuration, so start here:
Install a Compatible Docker Version
Rancher v1.x (the stable version at the time of Ubuntu 17.04's release) works best with Docker 18.06 or older. Install it properly:# Uninstall any old Docker packages sudo apt purge docker docker-engine docker.io containerd runc # Install dependencies sudo apt install apt-transport-https ca-certificates curl software-properties-common # Add Docker's official repository curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty stable" # Install Docker 18.06.3 sudo apt update && sudo apt install docker-ce=18.06.3~ce~3-0~ubuntu-zesty # Add your user to the docker group to avoid sudo for commands sudo usermod -aG docker $USERAfter logging out/in, try starting Rancher again with:
docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stableVerify VirtualBox Network Settings
If you're using Rancher with VirtualBox VMs, ensure your VM's network adapter is set to either Bridged Adapter (for access to your local network) or Host-Only Adapter (for isolated inter-VM communication). If you need a host-only network, create one via the terminal:# Create a host-only network VBoxManage hostonlyif create # Configure its IP address VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1 --netmask 255.255.255.0
If none of these steps resolve your issues, sharing the exact error messages you're seeing would help pinpoint the root cause more accurately.
内容的提问来源于stack exchange,提问作者Juan David Porras Palencia

