Skip to main content

Command Palette

Search for a command to run...

How to Start Linux in Command Prompt

Published
7 min readView as Markdown

Starting Linux from the command prompt might sound tricky, but it’s actually quite straightforward once you know the steps. Whether you want to boot into Linux from a Windows environment or access Linux commands directly, this guide will walk you through everything you need. You’ll learn how to launch Linux using different methods, including Windows Subsystem for Linux (WSL), virtual machines, and dual-boot setups.

If you’re new to Linux or just want to use Linux commands without leaving your current system, this article is for you. I’ll explain how to start Linux using the command prompt in simple terms, so you can get hands-on with Linux quickly and confidently. Let’s dive in and explore the best ways to start Linux from the command line.

What Does “Starting Linux in Command Prompt” Mean?

When people talk about starting Linux in the command prompt, they usually mean one of two things:

  • Running Linux commands inside a Windows command prompt or terminal.
  • Booting a Linux system using command-line instructions.

Linux is an operating system, and it usually runs on its own. But sometimes, you want to access Linux tools or start a Linux environment without rebooting your computer. This is where command prompts and terminals come in handy.

Running Linux Commands in Windows Command Prompt

Thanks to Windows Subsystem for Linux (WSL), you can run Linux commands directly from the Windows command prompt or PowerShell. WSL lets you install a Linux distribution like Ubuntu or Debian and run it alongside Windows.

Booting Linux Using Command Line

If you have a dual-boot system or a Linux machine, you might want to start Linux from the bootloader command prompt (like GRUB). This is more advanced but useful if your system doesn’t boot automatically or you want to select a specific Linux kernel.

How to Start Linux Using Windows Command Prompt (WSL)

One of the easiest ways to start Linux from the command prompt is by using Windows Subsystem for Linux. Here’s how you can set it up and start Linux:

Step 1: Enable WSL on Windows

Before you can run Linux, you need to enable WSL:

  • Open PowerShell as Administrator.
  • Run this command to enable WSL and Virtual Machine Platform:

    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    
  • Restart your computer.

Step 2: Install a Linux Distribution

After enabling WSL, install a Linux distro from the Microsoft Store:

  • Open the Microsoft Store.
  • Search for Ubuntu, Debian, or Kali Linux.
  • Click Install.

Step 3: Start Linux from Command Prompt

Once installed, you can start Linux by typing its name in the command prompt or PowerShell:

ubuntu

or

debian

This opens a Linux shell inside your Windows terminal.

Step 4: Use Linux Commands

Now you can run Linux commands like ls, cd, apt, and more directly from the command prompt. It behaves like a real Linux terminal.

Benefits of Using WSL

  • No need to reboot your computer.
  • Access Linux tools alongside Windows apps.
  • Easy to install and update.

Starting Linux from a Bootloader Command Prompt (GRUB)

If you have a dual-boot system with Windows and Linux, you might see a bootloader menu called GRUB when you start your computer. Sometimes, you need to start Linux manually from the GRUB command prompt.

What is GRUB?

GRUB (Grand Unified Bootloader) is a program that loads your operating system. It lets you choose between Windows, Linux, or other OSes installed on your machine.

How to Start Linux from GRUB Command Prompt

If your system boots to the GRUB prompt (instead of the menu), follow these steps:

  1. Find the Linux Partition

    Type:

    ls
    

    This lists all partitions, like (hd0,msdos1), (hd0,msdos2), etc.

  2. Set the Root Partition

    Identify the partition with Linux installed, then set it:

    set root=(hd0,msdos1)
    
  3. Load the Linux Kernel

    Load the kernel and initrd files:

    linux /boot/vmlinuz-<version> root=/dev/sda1
    initrd /boot/initrd.img-<version>
    

    Replace <version> with your kernel version and /dev/sda1 with your root partition.

  4. Boot Linux

    Finally, type:

    boot
    

This boots your Linux system manually.

When to Use GRUB Command Prompt

  • If your bootloader menu is missing or corrupted.
  • To troubleshoot boot issues.
  • To boot a specific kernel version.

Using a Virtual Machine to Start Linux from Command Prompt

Another way to start Linux from the command prompt is by using a virtual machine (VM). VMs let you run Linux inside Windows or macOS without changing your main system.

  • VirtualBox (free and open-source)
  • VMware Workstation Player (free for personal use)
  • Hyper-V (built into Windows Pro editions)

Starting Linux VM from Command Line

Most VM software lets you start a Linux VM using command-line tools:

  • For VirtualBox, use:

    VBoxManage startvm "LinuxVMName" --type headless
    
  • For VMware, use:

    vmrun start "path/to/your/vm.vmx"
    

This starts the Linux VM without opening the GUI. You can then connect via SSH or a console.

Benefits of Using a VM

  • Run full Linux OS without rebooting.
  • Test different Linux versions safely.
  • Easy to backup and restore.

Accessing Linux Commands via SSH from Command Prompt

If you have a remote Linux server or machine, you can start a Linux session from your Windows command prompt using SSH (Secure Shell).

How to Use SSH in Command Prompt

  1. Open Command Prompt or PowerShell.
  2. Type:

    ssh username@linux-server-ip
    
  3. Enter your password when prompted.

This connects you to the Linux machine’s shell, letting you run commands remotely.

Why Use SSH?

  • Manage Linux servers from anywhere.
  • Secure encrypted connection.
  • Run scripts and commands remotely.

Tips for Using Linux in Command Prompt

Once you start Linux in the command prompt, here are some tips to make your experience smoother:

  • Update your Linux distro regularly using sudo apt update && sudo apt upgrade.
  • Use tab completion to save typing.
  • Learn basic Linux commands like ls, cd, mkdir, rm.
  • Use man pages (man command) to get help on commands.
  • Customize your shell prompt for better visibility.

Troubleshooting Common Issues

Sometimes, starting Linux from the command prompt can run into problems. Here are common issues and fixes:

ProblemSolution
WSL not startingEnsure WSL is enabled and Windows is updated.
GRUB command not foundCheck if GRUB is installed correctly.
Virtual machine won’t startVerify VM settings and virtualization enabled.
SSH connection refusedCheck firewall and SSH service on Linux.

If you face errors, searching the exact message online often helps find quick solutions.

Conclusion

Starting Linux in the command prompt is easier than you might think. Whether you want to run Linux commands inside Windows using WSL, boot Linux manually from GRUB, or launch a Linux virtual machine, there are simple ways to get started. You don’t need to be a Linux expert to begin exploring the power of Linux through the command line.

By following the steps in this guide, you can access Linux environments quickly and efficiently. This opens up many possibilities for learning, development, and system management. So go ahead, try starting Linux from your command prompt today and see how it can boost your productivity and skills.

FAQs

How do I enable WSL on Windows?

Open PowerShell as Administrator and run:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Then restart your computer.

Can I run Linux commands without installing Linux?

Yes, using WSL on Windows lets you run Linux commands without a full Linux install.

What is the GRUB command prompt?

GRUB is a bootloader. Its command prompt lets you manually boot Linux if the menu doesn’t appear.

How do I start a Linux virtual machine from command line?

Use commands like VBoxManage startvm "VMName" --type headless for VirtualBox or vmrun start "path/to/vm.vmx" for VMware.

Can I connect to Linux remotely from Windows command prompt?

Yes, use SSH by typing ssh username@linux-server-ip in the command prompt or PowerShell.

More from this blog

L

LinuxBloke | Linux Tips, Tricks & Troubleshooting

672 posts