Verified Commit 8ff714d7 authored by Nicolas Froger's avatar Nicolas Froger
Browse files

vm: restructure, update some info



Signed-off-by: Nicolas Froger's avatarNicolas Froger <nico@cri.epita.fr>
parent 7ff1c73e
# How to setup and use the PIE VM
!!! warning
No support is done by the CRI on the PIE VM. If you do not succeed in
making it work by your own means, you must work on the school computers.
This method allow you to have the PIE environment running in a VM on your
computer.
There exists two installation : Virtualbox and VMWare. Note that VirtualBox has
shown numerous bugs on MacOS. VMWare is thus recommended for MacOS users.
## VirtualBox Installation
### First step
Install [Virtual Box](https://www.virtualbox.org/).
On linux you can install it with your package manager
([Debian](https://wiki.debian.org/VirtualBox) or
[ArchLinux](https://wiki.archlinux.org/index.php/VirtualBox)).
### Second step
Download our [VirtualBox appliance](https://static.cri.epita.fr/cri-vm.ova).
Open VirtualBox and go to `File > Import Appliance` and import the file you
just downloaded.
![appliance](assets/vm_external_1.PNG)
![import](assets/vm_external_2.PNG)
![folder](assets/vm_external_3.PNG)
When getting to the `Appliance settings` page, you may adjust the RAM and CPU
parameters. Be careful to have a least 2048 MB of RAM.
You can then click the `Import` button.
![settings](assets/vm_external_4.PNG)
### Third step
Inside Virtual Box select your newly created virtual machine and click on
the `Start` button.
![select](assets/vm_external_5.PNG)
In the familiar PXE menu, choose the `Prepare disk` entry.
Let it boot, a script will run automatically and your VM will shutdown once its
done.
![menu](assets/vm_external_6.PNG)
### Fourth step
You can now `Start` your VM again. You can now use the PXE menu as usual to
boot `Archlinux` image.
You can use the `skip-download` image to avoid downloading the image each time.
Be wary that this image may not be up to date and then have bugs. You should re-download
the VM every once in a while to be sure to have all the latest tools and potential bugs fixes.
You will find more information on this in the `cri.news` newsgroup.
!!! warning
Be careful ! You should log with `epita` user and no password. Your data is in
`/home/epita`, this directory is kept between reboot, you will not lose files
each time you stop your VM.
## VMWare Installation
### First step
Install VMWare Workstation : [VMWare Workstation](https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html)
On Linux you can download it with your package manager
([Debian](https://wiki.debian.org/VMware) or [Archlinux](https://wiki.archlinux.org/index.php/VMware)).
### Second step
Download our [VMWare appliance](https://static.cri.epita.fr/vmware-cri-vm.zip).
Unzip the folder in an appropriate location (you can use `unzip vmware-cri-vm.zip`).
Click on `Open a Virtual Machine`.
![import](assets/vmware.png)
Select the `CRI_VM` folder.
![import1](assets/import_vmware.png)
Select the `CRI VM.vmx` file.
![import2](assets/import2_vmware.png)
### Third step
You now have an imported VM. You can now run it by double clicking on it.
![imported](assets/vmware_vm.png)
In the familiar PXE menu, choose the `Prepare disk` entry.
Let it boot, a script will run automatically and your VM will shutdown once its
done.
![ipxemenu](assets/vmware_ipxe.png)
### Fourth step
You can now `Start` your VM again. You can now use the PXE menu as usual to
boot `Archlinux` image.
You can use the `skip-download` image to avoid downloading the image each time.
Be wary that this image may not be up to date and then have bugs. You should re-download
the VM every once in a while to be sure to have all the latest tools and potential bugs fixes.
You will find more information on this in the `cri.news` newsgroup.
!!! warning
Be careful ! You should log with `epita` user and no password. Your data is in
`/home/epita`, this directory is kept between reboot, you will not lose files
each time you stop your VM.
## Mac VMWare Installation
### First step
For MacOS, install VMWare Fusion : [VMWare Fusion](https://www.vmware.com/go/downloadfusion).
### Second step
Download the iso file [ISO](https://static.cri.epita.fr/cri-vm.iso).
Click on `Installer à partir du disque ou de l'image`.
![import](assets/macos_install_1.png)
Select the `cri-vm.iso` file.
![import1](assets/macos_install_2.png)
Select Linux > Autre noyau Linux 5.x et version ultérieur 64 bits.
![import2](assets/macos_install_3.png)
Select "BIOS hérité".
![import2](assets/macos_install_4.png)
Click on "Terminer" and save the VM.
![import2](assets/macos_install_5.png)
Before launching the VM, you need to edit the configuration.
Go to Machine Virtuelle > Paramètres.
![import2](assets/macos_configure_1.png)
Then edit "Processeurs et mémoires".
![import2](assets/macos_configure_2.png)
Put 4096 Mo (at least) of memory. If you can put more - if you have *enough* RAM
available. (Note that 4Go will probably be the maximum on a 8Go Mac).
![import2](assets/macos_configure_3.png)
Go back to the previous menu and click "Disque Dur (SCSI)".
![import2](assets/macos_configure_2.png)
Put (at least) 64 Go of disk space. Note that the disk format is optimized not to take
that much space on your disk.
![import2](assets/macos_configure_4.png)
### Third step
You now have an imported VM. You can now run it by double clicking on it.
![imported](assets/macos_launch.png)
In the familiar PXE menu, choose the `Prepare disk` entry.
Let it boot, a script will run automatically and your VM will shutdown once its
done.
![ipxemenu](assets/vmware_ipxe.png)
### Fourth step
You can now `Start` your VM again. You can now use the PXE menu as usual to
boot `Archlinux` image.
You can use the `skip-download` image to avoid downloading the image each time.
Be wary that this image may not be up to date and then have bugs. You should re-download
the VM every once in a while to be sure to have all the latest tools and potential bugs fixes.
You will find more information on this in the `cri.news` newsgroup.
!!! warning
Be careful ! You should log with `epita` user and no password. Your data is in
`/home/epita`, this directory is kept between reboot, you will not lose files
each time you stop your VM.
## Common issues
### Error: failed to start Switch Root.
![error-switch-root](assets/vm_error_switch_root.png)
You probably didn't start the `Prepare disk` image, please do the third step
again.
### Black screen after starting the VM
Please ensure you are using VirtualBox 6.1 (you can check in
`Help -> About VirtualBox`).
### Not in a hypervisor partition
![virt-disabled](assets/vm_error_virt_disabled.png)
You need to enable Vt-x or AMD-V in your BIOS.
### Cannot enable nested VT-x/AMD-V without nested-paging
![nested](assets/vm_error_nested.png)
Go to the VM settings window and in the `System` page and `Processor` tab,
uncheck the `Enable nested Vt-x/AMD-V` box.
### FATAL: Could not read from the boot medium! System halted
![no-boot-medium-display](assets/vm_error_no_boot_medium-1.png)
This issue often happens if you tried to install `VBoxGuestAdditions`. The
tools provided by VirtualBox are given as an ISO file. When you try to install
the tools, the ISO will replace your boot device.
To fix this issue, you need to re-attach the original boot device to your VM.
Go into your VM settings (`Settings -> Storage`)
!!! warning
Be careful ! You should only edit the `Controller: IDE` section of the Storage settings.
In the `Controller: IDE` section, you will either see nothing or the `VBoxGuestAdditions` iso.
##### `Controller: IDE` section is empty
![no-boot-medium](assets/vm_error_no_boot_medium-2.png)
Click on the little CD/ROM button on the `Controller: IDE` line.
![add-boot-iso](assets/vm_error_no_boot_medium-3.png)
Choose the iso called `PIE-disk001.iso`, it should have a size of ~1MB.
![add-boot-iso-menu](assets/vm_error_no_boot_medium-4.png)
You should now be able to boot your VM.
##### VBoxGuestAdditions iso is present in the `Controller: IDE` section
![guest-additions](assets/vm_error_no_boot_medium-5.png)
1. Select `VBoxGuestAdditions` iso.
2. Click on the disk icon on the right of the menu.
![guest-additions](assets/vm_error_no_boot_medium-6.png)
Choose the iso called `PIE-disk001.iso`.
![guest-additions](assets/vm_error_no_boot_medium-7.png)
You should now be able to boot your VM.
## Small tips for a better environment
### Screen resolution
You can use the command `xrandr` to change the resolution.
You can see the available resolutions with `xrandr` as following :
![resolution](assets/resolution.png)
You can change it using `xrandr --output Virtual-1 --auto --mode WIDTHxHEIGHT`
![xrandr](assets/xrandr.png)
### Term size
A command line program allows you to change the font size in your terminal.
You can use it with `term_size SIZE`. SIZE being the font size (12, 14, ...
for instance)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment