-
Notifications
You must be signed in to change notification settings - Fork 15
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 #3 from Jiab77/master
Merge old master code in branch 0.2
- Loading branch information
Showing
23 changed files
with
4,875 additions
and
1,053 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"oneDarkPro.italic": false, | ||
"oneDarkPro.vivid": true | ||
} |
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,78 +1,128 @@ | ||
# libVirt Web | ||
A simple web interface based on libVirt. | ||
|
||
A simple web interface based on [libVirt](https://libvirt.org/) and [PHP](https://www.php.net/). | ||
|
||
> This project is still a **Work In Progress**, it might not work correctly on your side. | ||
> | ||
> Please, create an issue in this case so I can track and fix it. | ||
> | ||
> Thank you. | ||
# Preview | ||
_If you were looking for a `nodejs` version: <https://github.com/Jiab77/libvirt-web-nodejs>._ | ||
|
||
## Preview | ||
|
||
 | ||
 | ||
|
||
# Installation | ||
## Installation | ||
|
||
The installation process is pretty simple and will require only few dependencies. | ||
|
||
The web interface should be able to run on desktops and servers. | ||
|
||
## Dependencies | ||
There is only few dependencies required, you will need at least five packages: | ||
|
||
1. `libvirt-bin` (The `virsh` command should be provided by [libVirt](https://libvirt.org/)) | ||
2. `virt-viewer` | ||
3. `php-cli` | ||
4. `php-json` | ||
5. `imagemagick` (For the `convert` command, used to convert screenshots from `PPM` to `PNG`) | ||
There is only few dependencies required: | ||
|
||
> The `imagemagick` package might be replaced later by `php-imagick` to keep depenencies on the `PHP` side. | ||
1. `libvirt-bin` (The `virsh` command should be provided by [libVirt](https://libvirt.org/)) | ||
2. `virt-viewer` | ||
3. `virt-install` | ||
4. `libguestfs` | ||
5. `php-cli` | ||
6. `php-gd` | ||
7. `php-xml` | ||
8. `php-json` | ||
|
||
> I have dropped the ImageMagick `convert` command from dependencies. | ||
## Plaforms | ||
|
||
The project has been tested on [Pop_OS!](https://system76.com/pop), a Linux distribution based on [Ubuntu 18.04 LTS](https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes). | ||
|
||
It is also tested on FreeBSD by my friend [@Sevendogs5](https://twitter.com/Sevendogs5). | ||
|
||
### Ubuntu and derivated distribs | ||
|
||
You should only need to install these packages: | ||
|
||
```bash | ||
sudo apt install libvirt-bin virt-viewer imagemagick php-cli php-json | ||
# For desktop | ||
sudo apt install libvirt-bin virt-viewer virtinst libguestfs-tools php-cli php-gd php-xml php-json | ||
|
||
# For server | ||
sudo apt install libvirt-bin virtinst libguestfs-tools php-cli php-gd php-xml php-json | ||
|
||
# For PHP < 7.4 | ||
sudo apt install ucspi-tcp | ||
``` | ||
|
||
> I need to validate the packages list so this might change later. | ||
> I still need to validate the packages list so this might change later. | ||
### FreeBSD | ||
|
||
Instruction will be provided soon. | ||
|
||
## Run the web interface | ||
|
||
You can run the web interface by using the embedded web server from `PHP` or using `apache` or `nginx`. | ||
|
||
### PHP Embedded Web Server | ||
|
||
You can start the server that way: | ||
|
||
```bash | ||
cd libvirt-web | ||
php -S localhost:8000 libvirt-web.php | ||
./start-local-server.sh | ||
``` | ||
|
||
> `sudo` is not required to run the server. It is required only if you want to run the server on a port below **1024**. | ||
> | ||
> You can also choose any other ports than **8000**. | ||
Then navigate to http://localhost:8000 with your internet browser. | ||
Then navigate to [http://localhost:8000](http://localhost:8000) with your internet browser. | ||
|
||
> I'm using Chromium but it should work on any other modern browser. | ||
### Apache / nginx | ||
|
||
This setup is not tested yet and will be documented later. | ||
|
||
# Thanks | ||
## Breaking Changes | ||
|
||
I've changed completely the project structure and now the code is splitted into several files instead of keeping everything into a single file. | ||
|
||
The more I was adding features and cleaner logic, the more it became difficult to maintain and keep it readable and understandable. | ||
|
||
So the best solution that came to me was split the single file into several ones, now it's much more easier to maintain the project. | ||
|
||
A single file version still exist if you look at the file `libvirtweb.aio.php` but it will not be supported anymore. | ||
|
||
## Missing / Not Working | ||
|
||
Here will be listed missing features / those not working correctly. | ||
|
||
* Remote connection on VM's using `virt-viewer`. | ||
* Works on local only... | ||
* Connection to remote hypervisor. | ||
* Not implemented yet / not correctly... | ||
* ISO image upload. | ||
* The upload is working but the uploaded file can't be moved to `/var/lib/libvirt/images`... | ||
* This is due to access restricted to `sudoers` with filesystem permissions. | ||
* Graphics are still missing. | ||
|
||
## Thanks | ||
|
||
Thanks to the respective developers for their amazing work. | ||
|
||
Huge thanks to [Ingmar Decker](http://www.webdecker.de) for the `PPM` Image Reader `PHP` class. | ||
|
||
Also thanks to my friend [@Sevendogs5](https://twitter.com/Sevendogs5) for supporting the FreeBSD platform. | ||
|
||
# Contributions | ||
## Contributions | ||
|
||
Feel free to contribute by creating pull requests or new issues. | ||
|
||
# Contact | ||
You can reach me on Twitter by using [@jiab77](https://twitter.com/jiab77). | ||
## Contact | ||
|
||
You can reach me on Twitter by using [@jiab77](https://twitter.com/jiab77). |
Oops, something went wrong.