# VirtualBox

## Creating the Virtual Machine

If you already have VirtualBox installed and the Debian ISO ready, we can proceed with creating the [virtual machine](https://fr.wikipedia.org/wiki/Machine_virtuelle).

{% hint style="danger" %}
**IMPORTANT FOR 42 STUDENTS:** On step 2, store the virtual machine inside the `sgoinfre` folder located on your campus server. This is crucial because you will run out of memory space in your user session, causing the installation to fail.

**BETTER ALTERNATIVE:** Use [external storage](https://amzn.to/4lbiCtI) (SSD/USB drive) as recommended above. This eliminates storage limitations and provides better performance than campus `sgoinfre` storage. And you can use it for all your 42 projects, not just this one.\
Even continuing your work at home by using VirtualBox on your personal computer, with your external storage device plugged in.
{% endhint %}

### Step-by-step VM creation:

1. **Open VirtualBox:** Launch VirtualBox and click the `New` button to create a new virtual machine.

   <figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-da38c24c855525564c8650ad24e264380800ee28%2Fimage.png?alt=media" alt="VirtualBox Dashboard"><figcaption><p>VirtualBox Dashboard</p></figcaption></figure>
2. **Configure VM name and location:** Choose a name for your virtual machine and select the folder where it will be stored.

   > <mark style="color:red;">**CRITICAL FOR 42 STUDENTS:**</mark> Store the machine inside the **sgoinfre** folder on your campus server to avoid running out of storage space. Ask students if you can't locate this folder. Or better, use an [<mark style="background-color:yellow;">**external storage**</mark>](https://amzn.to/4lbiCtI) device as recommended above.

   <figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-3227acf313d79d492ab9761371ecf339c3248ae9%2Fimage.png?alt=media" alt="VM Name and Location Setup"><figcaption><p>VM Name and Location Setup</p></figcaption></figure>
3. **Allocate** [**RAM memory**](https://en.wikipedia.org/wiki/Random-access_memory)**:** Select the amount of RAM memory to reserve for the virtual machine. **Recommended: 1024MB (1GB) minimum, 2048MB (2GB) for better performance.**

   <figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-e589106767657dc316079056f848351d1352ae44%2Fimage.png?alt=media" alt="RAM Memory Allocation"><figcaption><p>RAM Memory Allocation</p></figcaption></figure>
4. **Create virtual hard disk:** Select the second option to create a virtual hard disk now.

   <figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-95884fe0b0ccf16872989062a0251595263574e0%2Fimage.png?alt=media" alt="Virtual Hard Disk Creation"><figcaption><p>Virtual Hard Disk Creation</p></figcaption></figure>
5. **Choose disk type:** Select the first option `VDI (VirtualBox Disk Image)` as our disk format.

   <figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-e7f4276d64752047d8fbabf9ab85310817c2b17d%2Fimage.png?alt=media" alt="VDI selection from VirtualBox"><figcaption><p>VDI selection from VirtualBox</p></figcaption></figure>
6. Select the first option `Dynamically allocated` so it will allocate the memory of the physical machine as it feels necessary while using the virtual machine until we reach the available limit.

   <figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-c224828fa0613b8a128be59d865db1efadcaf2f6%2Fimage.png?alt=media" alt="Dynamically allocation on VirtualBox"><figcaption><p>Dynamically allocation on VirtualBox</p></figcaption></figure>
7. One we established the recommended `12 GB` we must click on `Create`. If we are doing the bonus we might set `30 GB`.

   <figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-0c0bd49b9cab2bb1bbfabab06a09ff7d24f9cf94%2Fimage.png?alt=media" alt="Storage size selection of the virtual machine"><figcaption><p>Storage size selection of the virtual machine</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://noreply.gitbook.io/born2beroot/installing-the-virtual-machine/virtualbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
