你经常听到你的朋友谈论Linux,或者你只是想知道哪个操作系统更适合你,Windows 还是 Linux(which OS is better for you, Windows or Linux)。您很想尝试一下,但您不完全确定您是否会喜欢Linux。有没有办法让你先试试看?幸运的是,有。
您可以使用VirtualBox在(VirtualBox)Windows 10中安装基于 Linux 的操作系统。虽然您可以将Linux 操作系统(Linux OS)与Windows一起双启动,但如果您选择在几天后放弃Linux 操作系统(Linux OS),VirtualBox会提供更清晰的选择。
如何使用 VirtualBox(Windows Using VirtualBox)在Windows 上安装Linux
您可以使用此方法安装任何 Linux 操作系统(install any Linux OS),但我们将在本教程中使用Ubuntu,因为它是最流行的。
1. 下载 Ubuntu 的 ISO(1. Download the ISO for Ubuntu)
首先下载适用于 Ubuntu 的 ISO(ISO for Ubuntu)。不要担心没有备用的空白磁盘或闪存驱动器。由于您使用 VirtualBox 安装 Ubuntu(installing Ubuntu with VirtualBox),因此您只需要 ISO。
最好使用LTS(长期支持)版本。当前的LTS版本是 Ubuntu 20.04.2 LTS。
2.下载VirtualBox
您需要在 PC 上下载(download)并安装VirtualBox 。您可以下载Windows软件包,但也有适用于Linux和 macOS 的软件包。请注意,安装过程可能会略有不同。
运行安装并按照提示进行操作。安装后,检查Ubuntu ISO是否已完成下载。如果有,您可以继续并为Ubuntu配置(Ubuntu)VirtualBox。
3. 为 Ubuntu 配置 VirtualBox
启动VirtualBox(VirtualBox)时,您将看到以下欢迎屏幕。单击(Click)新建(New)开始配置过程。
应该会弹出一个对话框。接下来,按照以下步骤操作:
- 为您的虚拟机命名(Name),例如Ubuntu v20.04.2 LTS。
- 单击(Click)Type旁边的下拉菜单,然后选择Linux。
- 选择版本(Version )为Ubuntu(64 位)或Ubuntu(32 位)。
- 为您的虚拟机分配内存大小。(Memory size)理想情况下,您应该选择分配大约四分之一的 PC内存(RAM)。例如,如果您有 16GB 的总RAM,请为虚拟机分配 4GB。
- 选择下一步(Next )按钮。
您还需要将一部分硬盘分配给虚拟机。这部分只能由您的虚拟操作系统访问,即本例中的Ubuntu。您有两种选择;您可以使用随着您继续使用存储而增长的动态分配(Dynamically allocated)存储,或者分配提供更快性能的固定大小存储限制。(Fixed-size)
- 在下一个屏幕上,您需要为虚拟机创建一个新硬盘。选择立即创建虚拟硬盘(Create a virtual hard disk now)选项并单击创建(Create)。
- 接下来,您需要选择要用于虚拟硬盘的文件类型。选择VDI (VirtualBox Disk Image)并选择Next。
- 选择动态分配(Dynamically allocated)并选择下一步(Next)。
- 您将在下一个屏幕上看到默认的VDI存储位置和大小,保持原样,然后选择Create。
这样就完成了配置过程的第一部分。我们的虚拟机已经设置好了,现在让我们继续将Ubuntu ISO添加到虚拟机中。如果您已经有一张Ubuntu CD/DVD,您可以将其插入驱动器并在虚拟机中使用它。
在继续之前,请确保您在 BIOS 设置中启用了硬件虚拟化。如果未启用,则后续步骤将不起作用。
现在,您将在 VirtualBox 的左侧边栏中看到Ubuntu 。选择它并单击设置(Settings)。
在“设置”(Settings)对话框的左侧栏中查找“存储”。(Storage)单击“(Click)属性(Attributes)”部分中的小磁盘图标,选择“选择磁盘文件(Choose a disk file)”,导航到 ISO,然后选择“确定(OK)” 。
您现在已准备好在您的虚拟机上安装Ubuntu 。
4. 开始安装 Ubuntu
首先单击VirtualBox主屏幕上的“开始(Start )”按钮。在弹出的对话框中选择Ubuntu ISO作为启动盘,然后选择(Ubuntu ISO)Start。
您将看到机器启动该过程。这可能需要几分钟的时间。
此时您有两个选择。您可以在继续安装之前尝试 Ubuntu(Try Ubuntu) ,或者如果您已经有信心,请安装 Ubuntu 。(Install Ubuntu)
如果您选择Try Ubuntu,您可以立即开始使用Ubuntu。或者,您可以选择安装 Ubuntu(Install Ubuntu)。
在安装Ubuntu之前,请记住您可以像使用任何其他操作系统一样使用它,但不能在虚拟机上存储任何数据。每次重新启动都是一个全新的开始,没有保留上一个会话的数据。
如果您选择继续安装选项,请选择安装 Ubuntu(Install Ubuntu)以启动安装。
- 选择您喜欢的键盘布局(Keyboard layout)。
- 继续按照安装向导的提示进行操作。系统可能会询问您是否要擦除磁盘并安装 Ubuntu(Erase disk and install Ubuntu)。这是正常的,只需选择立即安装(Install Now )并继续前进。
- 接下来,您将被要求选择您所在的地区。选择您所在的地区,然后选择继续(Continue)。
- 然后,您将被要求输入您的详细信息,例如您的姓名、计算机名称、用户名和密码。
- 安装向导将在收集详细信息后自行继续安装过程。这可能需要几分钟。
安装完成后,您的虚拟机将自动重新启动。再次运行虚拟机,它应该会启动到Ubuntu。
准备好将Ubuntu用作主要操作系统(Primary OS)了吗?
您可能最终会爱上这个免费的开源操作系统,以至于想要将它单独安装在您的系统上。您可以将Ubuntu安装为您的主要操作系统,也可以使用 Windows 对其进行双重引导(dual-boot it with Windows)。
How to Install Linux on Windows With VirtualBox
You hear your friends talk about Linux all the tіme, or maybe you’re just wondering which OS is better for you, Windows or Linux. You’re tempted to try it, but you’re not entirely sure if you’ll like Linux. Is there a way you could just try it out first? Fortunately, there is.
You can use VirtualBox to install a Linux-based OS within Windows 10. While you could dual-boot a Linux OS alongside Windows, VirtualBox offers a much cleaner slate if you choose to abandon the Linux OS after a few days.
How to Install Linux on Windows Using VirtualBox
You can install any Linux OS using this method, but we’ll use Ubuntu for this tutorial since it’s the most popular.
1. Download the ISO for Ubuntu
Start by downloading the ISO for Ubuntu. Don’t worry about not having a spare blank disk or flash drive lying around. Since you’re installing Ubuntu with VirtualBox, all you need is the ISO.
It’s ideal to use the LTS (long-term support) version. The current LTS version is Ubuntu 20.04.2 LTS.
2. Download VirtualBox
You’ll need to download and install VirtualBox on your PC. You can download the Windows package, but there are packages available for Linux and macOS as well. Note that the installation process may vary slightly among them.
Run the installation and follow the prompts. Once installed, check if the Ubuntu ISO has finished downloading. If it has, you can move forward and configure VirtualBox for Ubuntu.
3. Configure VirtualBox for Ubuntu
You’ll see the following welcome screen when you launch VirtualBox. Click on New to begin the configuration process.
A dialog box should pop up. Next, follow these steps:
- Give your Virtual Machine a Name, for instance, Ubuntu v20.04.2 LTS.
- Click on the drop-down menu besides Type and select Linux.
- Choose the Version as Ubuntu (64 bit) or Ubuntu (32 bit).
- Allocate Memory size to your virtual machine. Ideally, you should choose to allocate about a fourth of your PC’s RAM. For instance, if you have 16GB total RAM, allocate 4GB to the virtual machine.
- Select the Next button.
You’ll also need to allocate a portion of your hard disk to the virtual machine. This portion will only be accessible to your virtual operating system, i.e., Ubuntu in this case. You have two options to choose from; you could either use Dynamically allocated storage which grows as you keep using the storage, or allocate a Fixed-size storage limit that offers faster performance.
- On the next screen, you’ll need to create a new hard disk for your virtual machine. Choose the Create a virtual hard disk now option and click Create.
- Next, you’ll need to choose the type of file you’d like to use for the virtual hard disk. Choose VDI (VirtualBox Disk Image) and select Next.
- Choose Dynamically allocated and select Next.
- You’ll see the default VDI storage location and size on the next screen, leave them as they are, and select Create.
This completes the first part of the configuration process. Our virtual machine has been set up, so let’s now move forward and add the Ubuntu ISO to the virtual machine. If you already have an Ubuntu CD/DVD, you could insert that into the drive and use it in the virtual machine too.
Before moving forward, ensure that you have hardware virtualization enabled in your bios settings. If it’s not enabled, the next steps will not work.
You’ll now see Ubuntu listed on VirtualBox’s left sidebar. Select it and click on Settings.
Look for Storage on the left sidebar of the Settings dialog box. Click on the tiny disc icon in the Attributes section, select Choose a disk file, navigate to the ISO, and select OK.
You’re now ready to install Ubuntu on your virtual machine.
4. Begin Ubuntu Installation
Start by clicking the Start button on the VirtualBox home screen. Select the Ubuntu ISO as the start-up disk in the dialog box that pops up and select Start.
You’ll see the machine initiate the process. This may take a few minutes.
You have two options at this point. You could either Try Ubuntu before you move forward with the installation or Install Ubuntu if you feel confident already.
If you choose Try Ubuntu, you can start using Ubuntu right away. Alternatively, you could choose to Install Ubuntu.
Before installing Ubuntu, remember that you can use it like any other operating system, but you can’t store any data on a virtual machine. Every reboot is a fresh start with no data preserved from the previous session.
If you’ve chosen to move forward with the install option, select Install Ubuntu to initiate installation.
- Choose your preferred Keyboard layout.
- Keep following the installation wizard’s prompts. You may be asked if you want to Erase disk and install Ubuntu. This is normal, just select Install Now and move forward.
- Next, you’ll be asked to choose your region. Select your region and select Continue.
- You’ll then be asked to input your details such as your name, computer’s name, username, and password.
- The installation wizard will continue the installation process by itself after collecting the details. This could take a few minutes.
When the installation completes, your virtual machine will automatically reboot. Run the virtual machine again, and it should boot into Ubuntu.
Ready to Use Ubuntu as a Primary OS?
You might just end up falling in love with this free, open-source OS enough to want to install it separately on your system. You can either install Ubuntu as your primary OS or dual-boot it with Windows.