HehBot / CS695-A04

xv6 with namespaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Containers in xv6

This project implements restricted versions of Linux container primitives and provides a miniature docker-like utility to run containers on xv6.

Report link: report

Tutorial

Running xv6

  1. Clone the repo
git clone https://github.com/HehBot/CS695-A04
cd CS695-A04
  1. Now xv6 can be run either natively or in a Docker container.
  • To run natively:
sudo make run
  • To run in a Docker container:
sudo make docker-build
sudo make docker-run

This starts up a terminal in xv6.

  1. Press Ctrl-a + x to exit the xv6 terminal

Using conductor

  1. Once inside xv6 terminal, first execute
$ conductor init

to setup the containers folder.

  1. Now conductor run <image> <command> [args...] can be used to run any command inside a container based on given.

For example, following command runs ps command inside a contatiner based on sample image which is present by default in images folder.

$ conductor run sample ps

Example image demonstrating conductor run

  1. conductor exec <pid> <command> [args...] can be used to run a command inside an already running container.

For example, here a container is created which runs container_init which is a command that never ends in background by appending & at the end of command. Next it exec ps command into that container

Example image demonstrating conductor exec

  1. Execute conductor stop <pid> to stop container and delete it's folder.

Creating custom image

Inspect the script CS695-A04/uprogs/prepare_sample_image.sh and to make a similar custom script which makes new folder inside fsroot/image and copies required files into it. Add the custom script under all: in CS695-A04/uprogs/Makefile On running xv6 the image folder will now be present inside /image folder.

Credits

This repo was forked from xv6-net. This project was implemented as a part of Assignment-4 of CS695 Cloud computing and Virtualization course.

Contributors: Arnav Aditya Singh (210050018), Kevin Prafull Baua (210050084)

About

xv6 with namespaces

License:Other


Languages

Language:C 92.4%Language:Makefile 2.1%Language:Assembly 2.0%Language:Shell 1.3%Language:Perl 1.1%Language:Ruby 0.5%Language:OpenEdge ABL 0.4%Language:Dockerfile 0.0%Language:Emacs Lisp 0.0%