[1] Nginx Server Setup - VirtualBox Installation and Putty Connection
- 공유 링크 만들기
- X
- 이메일
- 기타 앱
# How to Set Up a Linux Virtual Environment for Testing Using VirtualBox on Windows 10
Setting up a Linux virtual environment can be helpful for testing purposes. This guide walks you through setting up a virtual machine on Windows 10 using VirtualBox.
1. VirtualBox Download
To begin, download VirtualBox.
- Go to VirtualBox Downloads. - Download the installer for your OS (choose "Windows hosts" for Windows 10).
After downloading, proceed with the installation by following the prompts.
2. RHEL (Red Hat Enterprise Linux) OS Download
Since CentOS reached its End of Life (EOL), it's recommended to use RHEL.
- Visit RHEL Downloads (version 9.4 as of 2024.11.02). - To use RHEL for free, register for an Individual Developer Subscription. There is no cost for registration.
3. VirtualBox - Setting Up a RHEL Virtual Machine
1. Create a New Machine - Open VirtualBox and click "New.", Set the storage path.
2. Set Up VM Password - Create a password for your VM account during the installation setup.
3. Allocate Resources to VM - Allocate resources based on your computer's specs. For example, assign 4 CPU cores and 8GB of RAM, and set the disk size to 20GB.
4. Software Selection - Select the necessary software. If a GUI is not needed, deselect GUI-related packages to save resources.
5. Connection Check - Confirm that the virtual machine is correctly set up by starting it and verifying the console output.
4. Connect to the VM Using Putty
- To connect to the VM, follow the steps below:
4-1. Verify VM Settings in VirtualBox
``` 1. Open VirtualBox, select the VM, and go to Settings. 2. Navigate to the Network tab, and set Adapter 1 to NAT. 3. Set up port forwarding rules:
- Name: Enter a name (e.g., SSH). - Host Port: Set an unused port on your host (e.g., 9999). - Guest Port: Enter 22 (default SSH port).
Example: "putty -(9999 port)> VM -(22 port)> Linux"
```
4-2. Internal VM Configuration
- Download and start the SSH server
``` sudo yum install -y openssh-server # Install SSH server sudo systemctl start sshd # Start SSH server sudo systemctl enable sshd # Enable SSH to start on boot ```
- Firewall configuration ``` sudo firewall-cmd --permanent --add-port=22/tcp sudo firewall-cmd --reload
```
- Modify SSH configuration ``` sudo vi /etc/ssh/sshd_config
Edit the file as follows (In VI, find the term with '/term', press 'a' to edit, then press ESC and type ':w' to save)
#PermitRootLogin $value -> PermitRootLogin yes (necessary if the ID is root) #PasswordAuthentication yes -> PasswordAuthentication yes (Remove # and change to yes)
Restart SSH to apply changes: sudo systemctl restart sshd
``` - Connection Verification
Related Links
Recommended Link
- 공유 링크 만들기
- X
- 이메일
- 기타 앱
댓글
댓글 쓰기