<commit_before>birsh
=====

**birsh** is a replacement to **libvirt** but in bash and without XML files (and with many less features, I admit) :)

I created this bash script to be able to quickly start virtual machines with **KVM** or **systemd-nspawn** (more or less container mode) on my laptop without playing with ton of XML files or an awful GUI tool.

The second mode is useful if you want to boot only one virtual machine without network needs (here the network is shared with the host) like quick test of a patch, build or software. The first mode can be used as many times as you want.

This tool lacks features at this time like graphical screen, removable media boot, disk management and the code is not necessarily beautiful but it works for me :) (and you can contribute)


Installation
------------

Just `make install`


Configuration
-------------

The main configuration file is `/etc/birsh/settings` and let you set the following items:

* `IMAGESFOLDER`: folder containing all disks
* `MOUNTFOLDER`: folder where to mount disks (for `nspawn`)
* `TMPFOLDER`: folder to put monitor sockets and temporary files (for `start`)
* `BRIDGE`: network device name for the bridge (for `start`)
* `BRIDGEUP`: optional setting to specify commands to execute after the bridge is up (eg. DHCP server)
* `GATEWAY`: network address of the host
* `NETWORK`: network to use for virtual machines (used for NAT)

The tool will automatically set NAT using `iptables` and create a /24 private network.


Requirements
------------

You must have these tools installed on your host: `brctl`, `ip`, `iptables`, `qemu-nbd`, `kpartx`, `socat`, `screen`, `systemd-nspawn` (optional).

`screen` is used to give you an access to the serial console of a KVM virtual machine. You should set `console=ttyS0` on the virtual machine's kernel boot argument to be able to use this feature.

`qemu-nbd` and `kpartx` are used for the `nspawn` mode.


Usage
-----

**birsh** _command_ _[options]_

### Commands

**birsh start** _name_ _-m size_  
Start a new virtual machine using _qemu-kvm_. Return the QEMU monitor socket.

* _name_ (mandatory): name of the disk to boot on
* **-m** _size_ (mandatory): set _size_ MB of memory to the virtual machine

<commit_msg>documenting -g for graphical output<commit_after>birsh
=====

**birsh** is a replacement to **libvirt** but in bash and without XML files (and with many less features, I admit) :)

I created this bash script to be able to quickly start virtual machines with **KVM** or **systemd-nspawn** (more or less container mode) on my laptop without playing with ton of XML files or an awful GUI tool.

The second mode is useful if you want to boot only one virtual machine without network needs (here the network is shared with the host) like quick test of a patch, build or software. The first mode can be used as many times as you want.

This tool lacks features at this time like graphical screen, removable media boot, disk management and the code is not necessarily beautiful but it works for me :) (and you can contribute)


Installation
------------

Just `make install`


Configuration
-------------

The main configuration file is `/etc/birsh/settings` and let you set the following items:

* `IMAGESFOLDER`: folder containing all disks
* `MOUNTFOLDER`: folder where to mount disks (for `nspawn`)
* `TMPFOLDER`: folder to put monitor sockets and temporary files (for `start`)
* `BRIDGE`: network device name for the bridge (for `start`)
* `BRIDGEUP`: optional setting to specify commands to execute after the bridge is up (eg. DHCP server)
* `GATEWAY`: network address of the host
* `NETWORK`: network to use for virtual machines (used for NAT)

The tool will automatically set NAT using `iptables` and create a /24 private network.


Requirements
------------

You must have these tools installed on your host: `brctl`, `ip`, `iptables`, `qemu-nbd`, `kpartx`, `socat`, `screen`, `systemd-nspawn` (optional).

`screen` is used to give you an access to the serial console of a KVM virtual machine. You should set `console=ttyS0` on the virtual machine's kernel boot argument to be able to use this feature.

`qemu-nbd` and `kpartx` are used for the `nspawn` mode.


Usage
-----

**birsh** _command_ _[options]_

### Commands

**birsh start** _name_ _-m size_ _[-g]_  
Start a new virtual machine using _qemu-kvm_. Return the QEMU monitor socket.

* _name_ (mandatory): name of the disk to boot on
* **-m** _size_ (mandatory): set _size_ MB of memory to the virtual machine
* **-g**: enable graphical output


{'fraction_non_alphanumeric': 0.09826335458342493, 'fraction_numerical': 0.0013189712024620796, 'mean_word_length': 4.033185840707965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5053636', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1268, 'n_words': 685}