Starting the Server

12006

Learning Objectives

  • Understand the basic concepts of the Debian system
  • Learn how to set up a virtual server locally
  • Master simple operations in the Debian system

1. Introduction to Setting Up the Server Environment

Debian is a free operating system developed by a volunteer team. It is suitable for various computer systems, such as servers and personal computers. Debian is based on the Linux and GNU toolset, and its source code is freely available for anyone to obtain, use, and modify. The Debian system is very stable and can support various applications.

In this lesson, we will use a virtualized server environment locally to set up a server and install the Debian system on it.

You need to install the software VMware Workstation Player on your computer. Here are the recommended minimum computer specifications:

  • Processor (CPU): At least 2 cores (more than 2 is recommended)
  • Memory (RAM): At least 2GB (more than 2GB is recommended)
  • Storage Space: At least 20GB (more than 20GB is recommended)

2. Installing VMware Workstation Player

VMware virtual machines are a technology that allows multiple operating systems to run on a single computer. This enables users to run different versions of applications on the same computer. This technology is very useful in testing and development environments, as it allows users to run multiple instances in a virtual machine without needing multiple computers.

Download Workstation Player: https://www.vmware.com/products/workstation-player.html

Image1.png

Install Workstation Player:

  1. Double-click the downloaded workstation-player-full-15.5.1-15018445.exe file to start the installation process.
  2. Read the license agreement, agree, and click "Next."
    Image3.png
  3. Choose the installation type and location, then click "Next."
    Image4.png
  4. User experience settings, then click "Next."
    Image5.png
    Image6.png
    Image7.png
  5. Click "Install" to begin the installation process.
    Image8.png
  6. Wait for the installation to complete, then click "Finish" to complete the installation process.
    Image9.png

3. Creating a Debian Virtual Machine

Download the Debian ISO Image File:

If the download speed is slow when clicking the link directly, you can use a third-party tool (like Thunder) to download.
https://cdimage.debian.org/cdimage/archive/11.7.0/amd64/iso-dvd/debian-11.7.0-amd64-DVD-1.iso

Create a New Virtual Machine:

  1. Open Workstation Player
  2. Click "Create a New Virtual Machine"
  3. Select "Custom (advanced)," then click "Next"
  4. Choose the virtual machine hardware compatibility, then click "Next"
  5. Select the installation media image file, choose the previously downloaded Debian image file, then click "Next"
  6. Operating system "Linux," select "Debian 10.x 64-bit," then click "Next"
  7. Enter the virtual machine name and storage location, then click "Next"
  8. Choose the number of processors and memory size for the virtual machine; allocate more memory if the host machine has enough, then click "Next"
  9. Select the network type as bridged network, then click "Next"
  10. Choose the I/O controller type as recommended, then click "Next"
  11. Choose the disk type as recommended, then click "Next"
  12. Select to create a new virtual disk, follow the default settings, then click "Next"
  13. Choose the disk type (it is recommended to select "Store virtual disk as a single file") and disk capacity, then click "Next"
  14. Choose the disk location, follow the default settings, then click "Next"
  15. Complete the virtual machine creation wizard, then click "Finish"

Start the Debian System Installation Wizard:

  1. Start the virtual machine
  2. Select "Graphical install," click continue
  3. Choose the language (e.g., "Chinese [Simplified]"), click continue
  4. Choose the region (e.g., "China"), click continue
  5. Choose the language for disk mapping (e.g., "Chinese"), click continue
  6. Configure the network (automatically), click continue after successful configuration
  7. Set the hostname
  8. Configure the domain name, leave it blank
  9. Set the login password for the root user
  10. Create a new user to replace the root user
  11. Create a login password for the newly created account
  12. Partition the disk, select "Use entire disk"
  13. Choose the disk to partition, continue
  14. For disk partitioning, select the option recommended for beginners
  15. Review the partitioning summary, select "Finish partitioning and write changes to disk," click "Continue"
  16. Write changes to disk, select "Yes"
  17. Configure package management, select "No"
  18. Configure network mirror, select "No"
  19. Choose software to install; generally, for a server, a GUI environment is not needed, just check "SSH Server, standard system tools." If a desktop environment is needed, also add "Debian desktop environment, GNOME."
  20. Install the GRUB bootloader, select "Yes"
  21. Choose the GRUB bootloader location as "/dev/sda," continue
  22. Software installation is complete, continue

4. Basic Use of the Debian Virtual Machine

Starting and Logging into the Virtual Machine:

  1. Start VMware Workstation
  2. Select the created Debian virtual machine
  3. Click "Power on this virtual machine"
  4. Log into the Debian system using the root user and password
  5. In the Debian virtual machine, find the terminal in the applications

Simple Operations in the Debian Virtual Machine:
The terminal is an important tool in the Debian system, allowing users to execute tasks by entering specific commands. Compared to the graphical user interface (GUI), the terminal is more flexible and powerful.

In the terminal, users can perform system management tasks, create, delete, edit files, execute various network operations, and write automation scripts. In this section, we will learn simple command operations in the terminal.

  • pwd: In the Debian system, you can use the command pwd to view the current working directory. To use this command, simply open the terminal, type pwd, and press Enter. This will immediately display the path of your current directory. When you log in as the root user and open the terminal, you will be in the /root directory.
  • ls: List files and directories in the current directory.
  • ip addr: Display and manage network interface addresses. With this command, you can find the server's IP address.
  • ping: Test the network connectivity between the server and another server. Enter the command: ping 8.8.8.8 and see what the response is. If the ping is successful, it indicates that the server's network connection is normal.

Logout, Restart, and Shutdown Commands:

  • exit, logout: Logout of the system
  • reboot: Restart the system
  • shutdown now, poweroff: Shutdown

Homework

  • Please download VMware and install the Debian system.
    • Download VMware and install it
    • Download the Debian ISO image
    • Create a virtual machine on VMware using the Debian image
    • Check if the Debian system is installed successfully and if the network is functioning well

Frequently Asked Questions

1. Network Configuration Failed During Debian System Installation

If the network configuration fails during the installation of the Debian system at step 6, it may be because your network did not automatically assign an IP to the Debian system:

Installing Debian - Network Auto Configuration Failed.png

In this case, you can manually set the network for the Debian system in the installer.

  1. In the previous step, click "Continue," and select "Manual network configuration":
    ip5.png

  2. Choose an IP from your local area network, manually fill it in the input box, and click "Continue." The network will then be configured:
    ip6.png

To obtain an IP from your local area network, you need to understand your LAN's network configuration. For example, if you are using a Windows computer connected to the network via WiFi, here’s how you can find an IP in the LAN:

  1. Run the command line tool (cmd), enter the command ipconfig to view your computer's IP:
    ip1.png
  2. Find the IPv4 address in the "Wireless LAN Adapter," such as 192.168.2.191
    ip2.png
  3. Choose a new IP: take the first three numbers of that IP 192.168.2, and for the fourth number, choose a different number from the IPv4 address in the "Wireless LAN Adapter," for example, 192. This number should be between 2 and 254.
  4. Run the command ping 192.168.2.192, at this point, you will find that the network is unreachable for that IP, indicating that no device in the current LAN is using that IP, so it can be used. If the network can ping, then choose another number and try again.
    ip4.png