[1] Nginx Server Setup - VirtualBox Installation and Putty Connection


# 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.


<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXGNSu5E1hlTqSe3iFQWEpiOxEN7eEosBCtdLD4pfwfX6c-PO9pFjcMLAWeT0qzIYcuxa4FwFjaH4fN8cZaIAqn3UB8g0yAgkmXocH9xBuHGzGrEbdb6T6-IK2y-pK9_4OujriHOc0yKlfmDkhWS4KwG-G2wnaFxmzEDBP86HowoMzAqnGaKQCyU88/s1600/1.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="virtualbox download" border="0" data-original-height="605" data-original-width="1317" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXGNSu5E1hlTqSe3iFQWEpiOxEN7eEosBCtdLD4pfwfX6c-PO9pFjcMLAWeT0qzIYcuxa4FwFjaH4fN8cZaIAqn3UB8g0yAgkmXocH9xBuHGzGrEbdb6T6-IK2y-pK9_4OujriHOc0yKlfmDkhWS4KwG-G2wnaFxmzEDBP86HowoMzAqnGaKQCyU88/s1600-rw/1.PNG"/></a></div>


- Go to [VirtualBox Downloads](https://www.virtualbox.org/wiki/Downloads).
- Download the installer for your OS (choose "Windows hosts" for Windows 10).

---

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipmGzcl3Etvjn_jz4LNsU1WrJAxSrO_WJEpXXu0pb8QE_H_nwQNwMPNxWESRcsVDAA1W8pmC9QwAlJTRgPbNlNlA9pCAFcrNVe8IJqvucTCauNw0K-acoKNfowi5ZQGzd_Hg02p7BhRoS_ux3r4nPMKxh24AlyAFJC642sFy3Qi0a4Au8QEI8szvlh/s1600/2.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="virtualbox download" border="0" data-original-height="392" data-original-width="495" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipmGzcl3Etvjn_jz4LNsU1WrJAxSrO_WJEpXXu0pb8QE_H_nwQNwMPNxWESRcsVDAA1W8pmC9QwAlJTRgPbNlNlA9pCAFcrNVe8IJqvucTCauNw0K-acoKNfowi5ZQGzd_Hg02p7BhRoS_ux3r4nPMKxh24AlyAFJC642sFy3Qi0a4Au8QEI8szvlh/s1600-rw/2.PNG"/></a></div>


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](https://developers.redhat.com/products/rhel/download) (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.

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_tM1mSUjnL_1o7MjHsitC6SJImfG3ticP_b9JWbIBCMQkVfXiySlQ3Ae25ZHFICM5lov5MQ1rYKBcUhwvW1Fvy_E0NJSSRSoePxF0uDc9aw7eIvhs7rJD92RqylstqDDYyVe_8DGqPYyBrkOnhOH9-JxR_HkeEMl26OjMN4E1ht89P45-J0G3oco/s1600/3.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="550" data-original-width="1273" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_tM1mSUjnL_1o7MjHsitC6SJImfG3ticP_b9JWbIBCMQkVfXiySlQ3Ae25ZHFICM5lov5MQ1rYKBcUhwvW1Fvy_E0NJSSRSoePxF0uDc9aw7eIvhs7rJD92RqylstqDDYyVe_8DGqPYyBrkOnhOH9-JxR_HkeEMl26OjMN4E1ht89P45-J0G3oco/s1600-rw/3.PNG"/></a></div>

---

2. **Set Up VM Password**
- Create a password for your VM account during the installation setup.
   
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUBlzzAzOm1Y5NxXJNoutXvCtUFZmv-S-97qJODjrJ4G8be95wp_pVcBt43VGML-x7JN4aW525R3kMdGuURjKbJ5nUjDz3GkqQHPTV_2hPKH3A4qYlQvAbzqgAWyGcXgx0Frty1lzhrq2dTOLX2rmUb9j8sgbJPvqgkjlTNU7h23zcU7E4wT6rkVnj/s1600/4.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="550" data-original-width="1275" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUBlzzAzOm1Y5NxXJNoutXvCtUFZmv-S-97qJODjrJ4G8be95wp_pVcBt43VGML-x7JN4aW525R3kMdGuURjKbJ5nUjDz3GkqQHPTV_2hPKH3A4qYlQvAbzqgAWyGcXgx0Frty1lzhrq2dTOLX2rmUb9j8sgbJPvqgkjlTNU7h23zcU7E4wT6rkVnj/s1600-rw/4.PNG"/></a></div>

---


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.

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQhkohwde5zibM-yJypU13AzMdB0P1oel9NlwHsuNo0-nuz-QeTO-QT7QIuvCvBWldMyDrsadERv8XMfqviCe1aDaJQ33eg2QRcwmp2rsRk-n2njP580uxY-rLloUbyTN5oQsxMmNGULYSX7rRGNfhlHAiYZMyvvRKeuDTFebqY3ZtPJoN-92r2hOO/s1600/5.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="546" data-original-width="1272" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQhkohwde5zibM-yJypU13AzMdB0P1oel9NlwHsuNo0-nuz-QeTO-QT7QIuvCvBWldMyDrsadERv8XMfqviCe1aDaJQ33eg2QRcwmp2rsRk-n2njP580uxY-rLloUbyTN5oQsxMmNGULYSX7rRGNfhlHAiYZMyvvRKeuDTFebqY3ZtPJoN-92r2hOO/s1600-rw/5.PNG"/></a></div>

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNHeCrjtQZ2AEJjLcoFjTNRC86XlElnBSAGj76rIUMGgRxZaBxCIcApaNE789LzcdwLDg7VtyDQ2aRSfvbh6ex-YGPZOACODqTNbqdIglLsgt79Oe3Tqim32zYB4zw07XSF8PsmCpOG17g6gzVp5GYFROHtHxhz_VV4g_6RxCrLyt5aI7h6r0kzt55/s1600/7.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="537" data-original-width="795" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNHeCrjtQZ2AEJjLcoFjTNRC86XlElnBSAGj76rIUMGgRxZaBxCIcApaNE789LzcdwLDg7VtyDQ2aRSfvbh6ex-YGPZOACODqTNbqdIglLsgt79Oe3Tqim32zYB4zw07XSF8PsmCpOG17g6gzVp5GYFROHtHxhz_VV4g_6RxCrLyt5aI7h6r0kzt55/s1600-rw/7.PNG"/></a></div>

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT8tdNvZTUkFcj4ylk1HVt4tm-YXbonb9445-VfODvoCqWftrmgc_CB7EY6-PwmDhYevv57ur5MRYdFltOmbwAjNNS9T3C-C2RmpuCqj89PmajKNFxRUd_1cig25CVsCrY0SP55lLaf2eHBQ2DMOwPV9FwabghHQNhUPgLdRPDLM8GiwlhPiSrEi1I/s1600/9.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="541" data-original-width="804" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT8tdNvZTUkFcj4ylk1HVt4tm-YXbonb9445-VfODvoCqWftrmgc_CB7EY6-PwmDhYevv57ur5MRYdFltOmbwAjNNS9T3C-C2RmpuCqj89PmajKNFxRUd_1cig25CVsCrY0SP55lLaf2eHBQ2DMOwPV9FwabghHQNhUPgLdRPDLM8GiwlhPiSrEi1I/s1600-rw/9.PNG"/></a></div>

---


4. **Software Selection**
- Select the necessary software. If a GUI is not needed, deselect GUI-related packages to save resources.

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNJaVOIfeY54chl50ekwH9WqyH8hAW_-dDvyIIAAgIy0PxI8d9vcmhrjKXjVG83_Wn-2XbIYF1XfC1VUKEBxyKizOEcsTEimwNjBmqDatfia_o8gE7Zvj986gTZzeibHBJdqyUe-EJhxqp1umAwXwRxA02RQKw4494pbtPmbrBkItkc24DNDkAjXn1/s1600/10.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="787" data-original-width="1288" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNJaVOIfeY54chl50ekwH9WqyH8hAW_-dDvyIIAAgIy0PxI8d9vcmhrjKXjVG83_Wn-2XbIYF1XfC1VUKEBxyKizOEcsTEimwNjBmqDatfia_o8gE7Zvj986gTZzeibHBJdqyUe-EJhxqp1umAwXwRxA02RQKw4494pbtPmbrBkItkc24DNDkAjXn1/s1600-rw/10.PNG"/></a></div>

---


5. **Connection Check**
- Confirm that the virtual machine is correctly set up by starting it and verifying the console output.

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvuQrM6NogSLnHRXQY1q9tfV9VpzaT3vMRTJMf1HZVhGbgHGKWZx9JndCbxJQozxhk3ySvsXq5XizNuwaWE9cewoUNO8COTc6anlrJfeuyHeZqbC3c4EKzP8YdjMd0Y8rcgTZmlabjtGkiKN-cJ_tfqISGDrSPmniNPxXWpu6B_181WfzcSs9UkZOt/s1600/11.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="255" data-original-width="711" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvuQrM6NogSLnHRXQY1q9tfV9VpzaT3vMRTJMf1HZVhGbgHGKWZx9JndCbxJQozxhk3ySvsXq5XizNuwaWE9cewoUNO8COTc6anlrJfeuyHeZqbC3c4EKzP8YdjMd0Y8rcgTZmlabjtGkiKN-cJ_tfqISGDrSPmniNPxXWpu6B_181WfzcSs9UkZOt/s1600-rw/11.PNG"/></a></div>

---

## 4. Connect to the VM Using Putty
- To connect to the VM, follow the steps below:

### 4-1. Verify VM Settings in VirtualBox

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLL8qpNKwUUhSfyQiLKIrQbVXLkAZNw5V2fQHT166vY-o040NhXKyUkxwIGc25605gcwJjIZMUQrsFKu4Zz30kv-OHama4nks5vsliBVBMeXSDeUglBocN4Y6zwyih1QRA5XfAeQREWJW_FG3Au5E3zJSH02_S9zsEkoirgcESTfeHlKx2nODGKg8b/s1600/13.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="442" data-original-width="1334" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLL8qpNKwUUhSfyQiLKIrQbVXLkAZNw5V2fQHT166vY-o040NhXKyUkxwIGc25605gcwJjIZMUQrsFKu4Zz30kv-OHama4nks5vsliBVBMeXSDeUglBocN4Y6zwyih1QRA5XfAeQREWJW_FG3Au5E3zJSH02_S9zsEkoirgcESTfeHlKx2nODGKg8b/s1600-rw/13.PNG"/></a></div>


```
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

<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT_Uridv769Ut7gGBMCxcr9OCF3kG16KKAshyphenhyphenbRikoxF20y1D_xgx-oUzKVnlM0Xa64u6GQ0X5rHy8zie4DU5y5j-1Y6V1AgXQeOk70uvxxT7foA5xHi6SxPVu_UjxZy-LruvXCnrT_6mXewN1nF4EmMSvStDqZh4SoxmxtfRUcO8xGxUbBStn8Gb4/s1600/12.PNG" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="411" data-original-width="659" loading="lazy" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT_Uridv769Ut7gGBMCxcr9OCF3kG16KKAshyphenhyphenbRikoxF20y1D_xgx-oUzKVnlM0Xa64u6GQ0X5rHy8zie4DU5y5j-1Y6V1AgXQeOk70uvxxT7foA5xHi6SxPVu_UjxZy-LruvXCnrT_6mXewN1nF4EmMSvStDqZh4SoxmxtfRUcO8xGxUbBStn8Gb4/s1600-rw/12.PNG"/></a></div>

---

<!-- 목록을 표시할 HTML 컨테이너 -->
<div>
    <h3>Related Links</h3>
    <ul id="label-post-list">
        <!-- 여기에 게시물 목록이 추가됩니다 -->
    </ul>
</div>

---

<!-- 목록을 표시할 HTML 컨테이너 -->
<div>
    <h3>Recommended Link</h3>
    <ul id="label-post-list-include">
        <!-- 여기에 게시물 목록이 추가됩니다 -->
    </ul>
</div>

---



댓글

이 블로그의 인기 게시물

윤석열 계엄령 선포! 방산주 대폭발? 관련주 투자 전략 완벽 분석

대통령 퇴진운동 관련주: 방송·통신·촛불수혜주 완벽 분석

키움 OPEN API MFC 개발 (1)