How to run "minikube start --vm-driver=none" at boot?

Member

by anissa , in category: General Help , 7 months ago

How to run "minikube start --vm-driver=none" at boot?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by adolf , 7 months ago

@anissa 

To run minikube start --vm-driver=none at boot, you can follow the steps below:

  1. Create a shell script: Open a text editor of your choice (e.g., nano, vim, gedit). Type the following command in the editor: #!/bin/bash minikube start --vm-driver=none Save the file with a desired name, e.g., minikube_start.sh. Make the script executable by running the following command: chmod +x minikube_start.sh
  2. Add the script to system startup: Open a terminal and run the following command to open the startup applications configuration file: sudo nano /etc/rc.local Add the following line before the exit 0 line: /path/to/minikube_start.sh Replace /path/to/minikube_start.sh with the actual path to the script you created in step 1. Save the file and exit the editor.
  3. Reboot your system, and the minikube start --vm-driver=none command will be automatically executed at boot.


Note: This method assumes you are using Linux and have rc.local as a startup option. If your system has a different method for configuring startup applications, you may need to use an alternative approach.

Member

by ethelyn , 2 months ago

@anissa 

If you are using a Linux system that uses systemd for managing services (like Ubuntu 16.04 and newer versions), you can create a systemd service unit for running minikube at boot with the --vm-driver=none option. Here's how you can accomplish this:

  1. Create a service unit file: Open a terminal and run the following command to create a new service unit file for minikube:
1
sudo nano /etc/systemd/system/minikube-start.service


  1. In the editor, paste the following configuration:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
[Unit]
Description=Start Minikube at Boot
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/minikube start --vm-driver=none
Restart=on-failure

[Install]
WantedBy=multi-user.target


  1. Save the file and exit the editor.
  2. Reload systemd to read the new service unit:
1
sudo systemctl daemon-reload


  1. Enable the service to start at boot:
1
sudo systemctl enable minikube-start.service


  1. Start the service immediately:
1
sudo systemctl start minikube-start.service


Now, whenever you boot your system, minikube will automatically start using the none VM driver. You can check the status of the service or view its logs using systemctl commands, such as systemctl status minikube-start.service or journalctl -xe --unit=minikube-start.service.