-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ItzPires/Implement-support-for-VMWare
Implement support for VMware and VMware ESXi
- Loading branch information
Showing
9 changed files
with
311 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
hello | ||
networkTest | ||
|
||
# Extra | ||
*.o | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,68 @@ | ||
# Unikernel---Proof-of-Concept | ||
Unikernel Proof of Concept | ||
# Unikernel - Proof of Concept | ||
|
||
## What is a Unikernel? | ||
|
||
A Unikernel is a specialised image that contains only the parts of the operating system and libraries needed to run a specific application. Unlike traditional operating systems, which are general, they support a wide range of functionalities. Unikernels are highly minimalist, focused on providing only the essentials for a single purpose, which makes them lighter and more secure. | ||
|
||
## Motivation | ||
|
||
Based on the Unikernel concept and what currently exists, it was decided to use the Linux kernel to turn it into a Unikernel. | ||
|
||
This project was born from an idea explored in the context of a Master's thesis. | ||
|
||
## Supported Execution Environments | ||
|
||
| Environment | :heavy_check_mark: / :x:| | ||
|--|--| | ||
|QEMU| :heavy_check_mark: | | ||
|VMware | :heavy_check_mark: | | ||
|VMware ESXi | :heavy_check_mark: | | ||
|
||
## Installation Guide | ||
|
||
Follow the steps below to configure and run the project: | ||
|
||
### Requirements | ||
- Install the necessary development tools and libraries: | ||
```bash | ||
sudo apt-get update | ||
sudo apt install build-essential | ||
sudo apt install flex | ||
sudo apt install bison | ||
sudo apt install libelf-dev | ||
sudo apt install libssl-dev | ||
sudo apt install bc | ||
sudo apt install busybox-static | ||
sudo apt install qemu | ||
``` | ||
|
||
#### Clone the project repository | ||
```bash | ||
git clone https://github.com/ItzPires/Unikernel---Proof-of-Concept.git | ||
cd Unikernel---Proof-of-Concept | ||
git submodule update --init --recursive | ||
``` | ||
|
||
#### Compilation | ||
- To compile the Unikernel, run the following command: | ||
```bash | ||
./Scripts/build.sh <path_to_binary> [additional_parameters] | ||
``` | ||
|
||
#### Execution | ||
- To run the Unikernel in QEMU: | ||
```bash | ||
./Scripts/run.sh -t qemu | ||
``` | ||
This command will open a monitor showing the execution of the proof of concept in a virtual machine. | ||
|
||
- To run the Unikernel in VMware: | ||
```bash | ||
./Scripts/run.sh -t vmware | ||
``` | ||
|
||
This command will generate a file called disk.vmx and disk.vmdk in the "/Output/vmware" folder. To run the kernel in VMware, open vmware with file '/Output/vmware/disk.vmx' and start the VM". | ||
|
||
- To run the Unikernel in VMware ESXi: | ||
|
||
You must follow all the creation steps in VMware and then export the virtual machine in OVF. With these export files, you can create a virtual machine in VMware ESXi. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
mount -t proc none /proc | ||
mount -t sysfs none /sys | ||
echo "[Unikernel Proof of Concept]" | ||
./scripts/mount_all_disks | ||
{{BINARY_AND_ARGS}} | ||
poweroff -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
# Base directory for mount points | ||
MOUNT_DIR_BASE="/mnt/disk" | ||
|
||
# Function to format and mount a disk | ||
setup_and_mount_disk() { | ||
local disk=$1 | ||
local mount_point="${MOUNT_DIR_BASE}${disk: -1}" | ||
|
||
major_minor=$(cat /sys/class/block/$disk/dev) | ||
mknod /dev/$disk b ${major_minor%:*} ${major_minor#*:} | ||
|
||
# Create a partition on the disk | ||
echo -e "n\np\n1\n\n\nw" | fdisk /dev/$disk | ||
|
||
# Create a new block device for the partition | ||
mknod /dev/${disk}1 b ${major_minor%:*} $((${major_minor#*:} + 1)) | ||
|
||
# Format the partition as ext4 | ||
./sbin/mke2fs -t ext4 /dev/${disk}1 | ||
|
||
# Create the mount point and mount the partition | ||
mkdir -p $mount_point | ||
mount -t ext4 /dev/${disk}1 $mount_point | ||
echo "Disc $disk mounted at $mount_point" | ||
} | ||
|
||
# Init | ||
mknod /dev/null c 1 3 | ||
mknod /dev/sda b 8 0 | ||
|
||
# Get the list of available disks | ||
for disk in $(ls /sys/class/block/ | grep -E '^sd[b-z]$'); do | ||
setup_and_mount_disk $disk | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.encoding = "windows-1252" | ||
config.version = "8" | ||
virtualHW.version = "8" | ||
pciBridge0.present = "TRUE" | ||
pciBridge4.present = "TRUE" | ||
pciBridge4.virtualDev = "pcieRootPort" | ||
pciBridge4.functions = "8" | ||
pciBridge5.present = "TRUE" | ||
pciBridge5.virtualDev = "pcieRootPort" | ||
pciBridge5.functions = "8" | ||
pciBridge6.present = "TRUE" | ||
pciBridge6.virtualDev = "pcieRootPort" | ||
pciBridge6.functions = "8" | ||
pciBridge7.present = "TRUE" | ||
pciBridge7.virtualDev = "pcieRootPort" | ||
pciBridge7.functions = "8" | ||
vmci0.present = "TRUE" | ||
hpet0.present = "TRUE" | ||
nvram = "{{IMAGE_NAME}}.nvram" | ||
virtualHW.productCompatibility = "hosted" | ||
powerType.powerOff = "soft" | ||
powerType.powerOn = "soft" | ||
powerType.suspend = "soft" | ||
powerType.reset = "soft" | ||
displayName = "{{IMAGE_NAME}}" | ||
guestOS = "other" | ||
tools.syncTime = "FALSE" | ||
cpuid.coresPerSocket = "1" | ||
memsize = "1024" | ||
ide0:0.fileName = "{{IMAGE_NAME}}.vmdk" | ||
ide0:0.present = "TRUE" | ||
ethernet0.virtualDev = "vmxnet3" | ||
ethernet0.connectionType = "nat" | ||
ethernet0.addressType = "generated" | ||
ethernet0.present = "TRUE" | ||
extendedConfigFile = "{{IMAGE_NAME}}.vmxf" | ||
floppy0.present = "FALSE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters