├── API └── cli.php ├── Backend └── vmm ├── CHANGELOG ├── Frontend └── vmweb ├── Helper ├── vmctl └── vmctl.c ├── LICENSE ├── README.md ├── install.sh ├── screenshots ├── scr587.png ├── scr589.png ├── scr590.png ├── scr592.png ├── scr597.png └── scr599.png ├── update.sh └── utils ├── bvcp-backend ├── bvcp-frontend └── bvcp-helper /API/cli.php: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/php 2 | 3 | enableAES($API_KEY); 20 | $res = $DP->query("PING",array("")); 21 | if($res["code"] != "PONG") 22 | { 23 | echo("\n\n -> Error: Unable to contact with VM Backend module\n"); 24 | exit(10); 25 | } 26 | 27 | $res = $DP->query("CLIENT",$argv); 28 | process($res); 29 | 30 | /** PROCESS **/ 31 | function process($res) 32 | { 33 | if($res["code"] == "OK") 34 | { 35 | if(is_array($res["meta"]) && count($res["meta"]) > 0) 36 | { 37 | echo("Command was success, results:\n"); 38 | print_r($res["meta"]); 39 | } 40 | else 41 | { 42 | echo("Command was success\n"); 43 | } 44 | 45 | exit(0); 46 | } 47 | else 48 | { 49 | echo("There was an error: ".$res["code"]."\n"); 50 | if(isset($res["meta"]["cli_error"])) 51 | { 52 | foreach($res["meta"]["cli_error"] as $k=>$v) 53 | { 54 | echo(" ".$v."\n"); 55 | } 56 | } 57 | else if(isset($res["meta"]["error"])) 58 | { 59 | echo("Error: ".$res["meta"]["error"]."\n"); 60 | } 61 | 62 | exit(1); 63 | } 64 | 65 | } 66 | /** PROCESS **/ 67 | 68 | /** DPROTOCOL CLASS **/ 69 | class DProtocol /** VERSION 2.0 **/ 70 | { 71 | var $protocol_version = "2"; 72 | var $host = ""; 73 | var $port = ""; 74 | var $sock; 75 | var $timeout = 5; 76 | var $key = NULL; 77 | var $data; 78 | 79 | /** CONSTRCUTOR **/ 80 | function __construct($host,$port,$timeo = 0) 81 | { 82 | $this->host = $host; 83 | $this->port = $port; 84 | 85 | if($timeo > 0) 86 | { 87 | $this->timeout = $timeo; 88 | } 89 | } 90 | /** CONSTRCUTOR **/ 91 | 92 | /** DESTRUCTOR **/ 93 | function __destruct() 94 | { 95 | if(is_resource($this->sock)) 96 | { 97 | fclose($this->sock); 98 | } 99 | } 100 | /** DESTRUCTOR **/ 101 | 102 | /** _FREAD **/ 103 | function _fread($sock,$len) 104 | { 105 | $ret = ""; 106 | $wlen = 0; 107 | 108 | while(true) 109 | { 110 | $delta = $len - $wlen; 111 | if($delta <= 0) 112 | { 113 | break; 114 | } 115 | 116 | $tmp = fread($sock,$delta); 117 | if(!$tmp) 118 | { 119 | break; 120 | } 121 | 122 | $ret .= $tmp; 123 | $wlen += strlen($tmp); 124 | } 125 | 126 | return $ret; 127 | } 128 | /** _FREAD **/ 129 | 130 | /** EC **/ 131 | function ec($string,$iv) 132 | { 133 | $key = hash("md5",$this->key,true); 134 | $encrypted = openssl_encrypt($string, "AES-128-CBC", $key, $options=OPENSSL_RAW_DATA, $iv); 135 | return $encrypted; 136 | } 137 | /** EC **/ 138 | 139 | /** DEC **/ 140 | function dec($string,$iv) 141 | { 142 | $key = hash("md5",$this->key,true); 143 | $result = openssl_decrypt($string, "AES-128-CBC", $key, $options=OPENSSL_RAW_DATA, $iv); 144 | return $result; 145 | } 146 | /** DEC **/ 147 | 148 | 149 | /** SETTIMEOUT **/ 150 | function setTimeout($timeo) 151 | { 152 | $this->timeout = $timeo; 153 | } 154 | /** SETTIMEOUT **/ 155 | 156 | /** FWRITE_STREAM **/ 157 | function fwrite_stream($fp, $string) 158 | { 159 | for ($written = 0; $written < strlen($string); $written += $fwrite) 160 | { 161 | $fwrite = fwrite($fp, substr($string, $written)); 162 | if ($fwrite === false) 163 | { 164 | return $written; 165 | } 166 | } 167 | return $written; 168 | } 169 | /** FWRITE_STREAM **/ 170 | 171 | /** ENABLEAES **/ 172 | function enableAES($key) 173 | { 174 | $this->key = $key; 175 | } 176 | /** ENABLEAES **/ 177 | 178 | /** QUERY **/ 179 | function query($code,$arr,$data = NULL) 180 | { 181 | $this->data = array(); 182 | if(!is_resource($this->sock)) 183 | { 184 | $this->sock = stream_socket_client("tcp://".$this->host.":".$this->port, $errno, $errstr, $this->timeout); 185 | if(!$this->sock) 186 | { 187 | return false; 188 | } 189 | } 190 | 191 | if($this->key) 192 | { 193 | $iv = hash("md5",$code.mt_rand(0,9999999).time(),true); 194 | } 195 | 196 | if($this->protocol_version > 1) 197 | { 198 | $arr = serialize($arr); 199 | } 200 | else 201 | { 202 | $arr = json_encode($arr); 203 | } 204 | 205 | $arr = gzencode($arr,1); 206 | if($this->key) 207 | { 208 | $arr = $this->ec($arr,$iv); 209 | } 210 | 211 | if($data != "") 212 | { 213 | $data = gzencode($data,1); 214 | if($this->key) 215 | { 216 | $data = $this->ec($data,$iv); 217 | } 218 | } 219 | 220 | 221 | $header = "D".$code.".".$this->protocol_version.".".strlen($arr).".".strlen($data)."."; 222 | if($this->key) 223 | { 224 | $header .= "1"; 225 | } 226 | else 227 | { 228 | $header .= "0"; 229 | } 230 | $header .= "\n"; 231 | 232 | $this->fwrite_stream($this->sock,$header); 233 | if($this->key) 234 | { 235 | $this->fwrite_stream($this->sock,$iv); 236 | } 237 | 238 | $this->fwrite_stream($this->sock,$arr); 239 | if($data) 240 | { 241 | $this->fwrite_stream($this->sock,$data); 242 | } 243 | 244 | /** RESPONSE **/ 245 | $rheader = trim(fgets($this->sock)); 246 | $this->data["header"] = substr($rheader,1); 247 | if(substr($this->data["header"],0,1) == ":") 248 | { 249 | $this->data["code"] = "int_error"; 250 | $this->data["error"] = substr($this->data["header"],1); 251 | return $this->data; 252 | } 253 | 254 | $ex = explode(".",$this->data["header"]); 255 | $this->data["code"] = $ex[0]; 256 | $this->data["protocol_version"] = $ex[1]; 257 | $this->data["meta_len"] = $ex[2]; 258 | $this->data["data_len"] = $ex[3]; 259 | $this->data["crypt"] = $ex[4]; 260 | 261 | if($this->data["crypt"] == "1") 262 | { 263 | $iv = $this->_fread($this->sock,16); 264 | } 265 | 266 | $META = $this->_fread($this->sock,$this->data["meta_len"]); 267 | 268 | if($this->data["data_len"] > 0) 269 | { 270 | $DATA = $this->_fread($this->sock,$this->data["data_len"]); 271 | } 272 | 273 | if($this->data["crypt"] == "1") 274 | { 275 | $META = $this->dec($META,$iv); 276 | if($this->data["data_len"]) 277 | { 278 | $DATA = $this->dec($DATA,$iv); 279 | } 280 | } 281 | 282 | if($this->data["protocol_version"] == "1") 283 | { 284 | $this->data["meta"] = json_decode(gzdecode($META), true); 285 | } 286 | else if($this->data["protocol_version"] == "2") 287 | { 288 | $this->data["meta"] = unserialize(gzdecode($META)); 289 | } 290 | 291 | if($this->data["data_len"] > 0) 292 | { 293 | $this->data["data"] = gzdecode($DATA); 294 | } 295 | /** RESPONSE **/ 296 | 297 | return $this->data; 298 | } 299 | /** QUERY **/ 300 | } 301 | /** DPROTOCOL CLASS **/ 302 | ?> 303 | -------------------------------------------------------------------------------- /Backend/vmm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaVieS007/bhyve-webadmin/c9e3144608beba7135428fadc8e295d80abfab30/Backend/vmm -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | WARNING, BEFORE YOU UPDATE FROM V1 TO V2: 2 | From version 2.x PCI Device IDs are statically assigned, that can cause Guest Virtual Machines might be needs to be adjusted. 3 | From version 2.x maximum allowed ISO mounts is limited to 6, maximum Virtual Disks are 12 and 8 extra PCI slot including (NIC, Passthru) devices. 4 | 5 | v.2.1.4-release 6 | 2024.04.02: Added better implementation of truncate() and warning 7 | 2024.04.02: Fix resize disk truncate() error when the input isn't natural number 8 | 2024.04.02: Fix resize disk above 1TB cause truncate() error, because of scientific notations 9 | 2024.03.29: Fix error message contains variable which does not exists [GHUB-55] 10 | 11 | v.2.1.2-release 12 | 2024.02.23: Allow attach and create new disk at the same time 13 | 2024.02.23: Allow modify disk when detached or foreign 14 | 2024.02.23: Fix error when foreign or missing disk presents (`the index '1' does not exist at application/vmclient/web/webadmin/vm/details.c(685)`) 15 | 2024.02.20: Fix missing incoming connection on sysinfo menu 16 | 2024.02.20: Change layout to 5-7 on dashboard 17 | 18 | v.2.1.0-p1-release 19 | 2024.02.20: Added correct boot order, padding PCI slots to avoid EFI shell prompted on first place 20 | 2024.02.20: System accept fraction numbers for memory settings, also displaying correctly up to 2 decimal points 21 | 2024.02.20: Fixed reconnection issue that elliminates (partial data received warnings) 22 | 2024.02.20: Hardware configuration now colored to determine easier what configuration an user can modify 23 | 2024.02.20: Better ajax calls on VM list, VMs are displayed realtime 24 | 2024.02.20: Added loading screen to pages that might loads slower 25 | 2024.02.20: Show assigned users on the list page 26 | 2024.02.20: Allow edit VM description by the user 27 | 2024.02.19: Added option to reset UEFI BIOS Settings. 28 | 2024.02.19: FIX: Minor HDD LUN numbers (collision avoidance) could changed according to directory cache and file names, now they are assigned to database ID. 29 | 2024.02.19: Automatically re-set log, uefi files permissions to 0600 for security reasons despite the folder settings. 30 | 31 | v.2.0.8-release 32 | 2024.02.18: Hotfix: `wrong number of parameters (2 passed, 4 required) at application/vmclient/web/webadmin/vm/Forms/create_vm.c(130)` 33 | 2024.02.18: Hotfix: Edit Name / Description leads to an error 34 | 2024.02.18: Hotfix: Add support to older systems and an update warning. 35 | 2024.02.18: Hotfix: When add Intel-1000 legacy adapter two of them appear. 36 | 2024.02.18: Hotfix: Possibly get rid of remaining startup issues by clearing vminfo cache, by renaming it into new key. 37 | 2024.02.18: Hotfix: Fix some startup issues following migration process, `the index 'time' does not exist`, `the index 'custom' does not exist` 38 | 2024.02.17: Better garbage collection mechanism 39 | 2024.02.17: Security Prompt when user using default admin account 40 | 2024.02.17: Fixed native bhyve logging 41 | 2024.02.17: Add Option to set host's TAP IP Address (useful for special routing cases with pfSense) 42 | 2024.02.17: Added feature: UEFI Storage to save UEFI settings 43 | 2024.02.17: Mutexing noVNC concurrent sessions, admins grab axplicit lock over the console 44 | 2024.02.17: noVNC can handle VM Power Options (start, stop, restart, shutdown), better BVCP integration 45 | 2024.02.17: Reduced Memory footprint 46 | 2024.02.15: Added support for PCI-Passthrough DMAR, AMDVi 47 | 2024.02.14: Added Backend compatibility check 48 | 2024.02.14: Preserve Machine Statistics 49 | 2024.02.14: Database structure & serialization optimisation 50 | 2024.02.11: Dashboard interface now contains VERY USEFUL node statistics, warnings and alerts 51 | 2024.02.11: Fix race condition which cause the software does not exit - just hangs - 52 | 2024.02.11: Significantly improved the overall speed by changing JIT mechanism 53 | 2024.02.02: Fix `the index 'state' does not exist at application/vmclient/web/webadmin/dashboard/main.c(96)` related errors 54 | 2024.02.02: Fix `the index 'name' does not exist at application/vmclient/web/webadmin/vm/list.c(109)` error 55 | 2024.02.02: Max allowed CPU Count adjusted to sysctl variables 56 | 2024.02.02: Better way to check of requirements of bhyve core, IOMMU, max cpu count 57 | 58 | v.1.9.8-p9-release 59 | 2024.01.02: Implement protocol version-3 but uses 2 by default for compatibility 60 | 2023.11.30: Updated ABC, Numeric short method on select input now correctly rearrange items by alphabet order 61 | 2023.11.30: Better support for symlinks, correctly shows the target size 62 | 2023.11.30: Fix error when the connection aborts between frontend - backend and the query parameters contains non-string type 63 | 2023.11.30: Updated serialization library which increased the overall speed 64 | 2023.11.30: Updated string library which increased the overall speed 65 | 2023.11.30: Fix: VM name could be empty on creation which leads to malfunction [GHUB-46] 66 | 2023.12.29: Showing VM's name instead at dashboard when no descriptive text provided [GHUB-44] 67 | 68 | v.1.9.8-p8-release 69 | 2023.12.23: Increased stability, this version fixes VNC random dropouts 70 | 2023.12.22: Reduced HTTP Error and Debug messages on the log 71 | 2023.12.20: Limiting emails sent when session changes 72 | 73 | v.1.9.8-p7-release 74 | 2023.11.09: Adding additional parameters to a self-signed certificate at install to comply with newest requirements in Chrome Browsers 75 | 76 | v.1.9.8-p6-release 77 | 2023.07.23: small UI fixes 78 | 2023.07.20: fix bug related to missing POST fields when modifying disks 79 | 2023.07.12: proc_open hung up on older systems when pipes have data left 80 | 2023.06.21: Memory Leak fix: Send Buffers did not released correctly 81 | 2023.06.12: Fix Not Supported headers on invalid HTTP versions 82 | 2023.06.12: Fix HTTP/1.1 C100 response on PUT requests 83 | 2023.06.11: Fix errors when client sends malformed HTTP packets 84 | 85 | v.1.9.8-p5-release 86 | 2023.05.29: Possible fix for VNC shutdowns, flickering 87 | 2023.05.29: Code cleanup 88 | 2023.05.20: BVCP now fault tolarent, errors wont disrupt the normal workflow 89 | 2023.05.16: Fix negative numbers against gmtime(&) cause random behavior on some systems [framework] 90 | 2023.05.15: Fix conditional-race winning on thread-pool code [framework] 91 | 92 | v.1.9.8-p4-release 93 | 2023.05.07: Fix stucked or out-of-sync filesystem statistics 94 | 2023.05.01: Fixed errors which comes from debugging enabled 95 | 2023.04.30: Fixed HTTP Server Error, inproperly handling partially received data causes errors 96 | 97 | v.1.9.8-p3-release 98 | 2023.04.26: Fixed error `the index 'state' does not exist at application/vmclient/web/webadmin/vm/details.c(723)` 99 | 2023.04.26: Fixed error `the index 'msg' does not exist at utils/Mailer.class.c(1071)` 100 | 2023.04.26: Fixed error `the index 'meta' does not exist at application/vmclient/web/webadmin/vm/details.c(461)` 101 | 2023.04.26: Fixed error `the index 'SID' does not exist at bhyve/vm_disk.class.c(375)` 102 | 103 | v.1.9.8-p2-release 104 | 2023.04.18: Fixed error when the system tries to send email to a non-email address 105 | 2023.04.17: Missing or broken Disks are able to force remove from VM 106 | 2023.04.16: (IMPORTANT CHANGE) Fixed NVME IDs unintentionally includes (") which FreeBSD guests display as %22 107 | 108 | v.1.9.8-p1-release 109 | NOTE: This release contains only optimisations and bugfixes. 110 | 2023.04.08: Better Error Handling 111 | 2023.04.01: ZLIB does not cause exit when throw error 112 | 2023.04.01: Updated builtin CA-Certificates 113 | 2023.04.01: Updated OUI Database 114 | 2023.04.01: Improved Network latency between nodes 115 | 2023.04.01: Fixed HTTP issues when CRLF packets comes lately and not using TLS/SSL 116 | 117 | v.1.9.8-release 118 | 2023.03.21: HOTFIX: Detached disks are not removed properly 119 | 2023.03.15: RFB/VNC Fixes hangup when multiple connections made up to the Bhyve 120 | 2023.03.15: RFB/VNC Fixes wrong nullptr randomly cause API Key mismatch error 121 | 2023.03.08: Pretty Colored Console Output 122 | 2023.03.04: RFB/VNC encapsulated TLS Traffic now uses AES and Compression instead for better latency times 123 | 2023.02.18: Fixed errors when invalid arguments omitted in http requests 124 | 2023.02.04: Fixed previously badly fixed error `the index 'stat' does not exist at application/vmclient/web/webadmin/connect/main.c(111)` 125 | 2023.02.02: Fixed API missing arguments cause error due invalid calculations of parameters 126 | 2023.02.01: Improved network for PIPES, vnc connections are now faster [framework] 127 | 2023.01.28: Fixed shutdown hangups by using valid reference counters on desctructors [framework] 128 | 129 | v.1.9.6-release 130 | NOTE: This release contains only optimisations and bugfixes. 131 | 2023.01.15: Fixed error `the index 'storage' does not exist at application/vmclient/web/webadmin/vm/Forms/inline_hdd_add.c(51)` 132 | 2023.01.14: Fixed error `the index 'mount' does not exist at application/vmclient/web/webadmin/vm/Forms/inline_cdrom.c(59)` 133 | 2023.01.14: Fixed error `the index 'meta' does not exist at application/vmclient/web/webadmin/vm/Forms/inline_cdrom.c(68)` 134 | 2023.01.03: Fixed error `the index 'stat' does not exist at application/vmclient/web/webadmin/connect/main.c(111)` 135 | 2023.01.03: Fixed error `the index 'mail' does not exist at utils/Mailer.class.c(1230)` 136 | 2023.01.03: Fixed error `the index 'description' does not exist at application/vmclient/web/webadmin/dashboard/main.c(120)` 137 | 2023.01.03: Fixed error `the index '1' does not exist at application/vmclient/web/webadmin/core/bvcp_auth.c(271)` 138 | 2022.12.28: Fixed error `the index 'switch' does not exist at application/vmclient/web/webadmin/vm/Forms/inline_nic_add.c(50)` 139 | 2022.12.28: Fixed error `the index 'PID' does not exist at application/vmserver/rfb//handle.c(53)` 140 | 141 | v.1.9.4-release 142 | NOTE: This release contains only optimisations and bugfixes. 143 | 2022.12.21: Fixed DProtocol Error messages 144 | 2022.12.21: Fixed error when config contains invalid email and mail could not be sent 145 | 2022.12.21: Showing version name on both Backend and Frontend 146 | 2022.12.21: Fixed RFB Protocol invalid data handling 147 | 2022.12.20: Fixed thread-pool memory issues which causes instability on some systems 148 | 149 | v.1.9.2-release 150 | NOTE: This release contains only optimisations and bugfixes. 151 | 2022.12.06: Threadpool fix that is not affecting on FreeBSD, but for sure. 152 | 2022.12.05: Fix invalid array assign when listing mounted filesystems, merge with b213 framework 153 | 2022.11.20: using conditional_locks and dynamic mutexers for speed improvements [framework] 154 | 2022.11.18: new TCP & UDP network stack for future use like for VNC-PROXY [framework] 155 | 2022.10.05: Mutexing some ambiguous fs syscall [condition-race] (OS-BUG) [framework] 156 | 2022.10.02: Fix memory leak at hashing functions [framework-issue] 157 | 2022.09.30: Better Logger buffering and output [framework] 158 | 2022.09.25: (High-Availability) Guardian implementation both on frontend and backend [framework] 159 | 160 | v.1.9.0-release-p3 161 | 2022.09.17: fix websocket-hybi condition race with opcode [framework-issue] 162 | 2022.09.17: fix serialization become corrupted when class are used 163 | 2022.09.17: fix DProtocol stuck in loop in rare circumstances 164 | 165 | v.1.9.0-release-p2 166 | 2022.09.10: fix SSL_Accept() hang when non-https requests sent to the server [framework-issue] 167 | 2022.09.10: fix Malformed HTTP headers sent back when protocol not defined 168 | 169 | v.1.9.0-release-p1 170 | 2022.09.09: hotfix broken cdrom drives 171 | 172 | v.1.9.0-release 173 | 2022.09.09: Fix nullptr termination on challenge key 174 | 2022.09.09: Fix ssl handshake error on high latency networks [framework-issue] 175 | 2022.09.08: Add more security to VNC/Console against replay-attack 176 | 2022.09.08: Fix new syscall (proc_open) closing random file descriptor when initialises due condition race [framework-issue] 177 | 2022.09.08: Fix VNC/Console resource wasting when nobody attached to console 178 | 2022.09.08: Fix CPU loop on main thread due socket pipes [framework-issue] 179 | 2022.09.07: Fix DProtocol length too small error 180 | 2022.09.07: Release rollback before launch due compatibility issues with new framework 181 | 2022.09.07: Code cleanup and overall speed improvement 182 | 2022.09.05: Fix rare event where send buffer remains untouched (intr) 183 | 2022.09.05: framework upgrade, small changes on logging system 184 | 2022.09.05: Changing existing NIC's MAC Address 185 | 2022.09.04: Fix when new switch created and interface not bound if selected 186 | 2022.09.03: Grammar Fixes, Better displaying backend errors 187 | 2022.09.02: Fix Interface MTU will be adjusted to the bridge 188 | 2022.09.02: Fix (_) and whitespace markings on network switches cause problems 189 | 2022.09.01: Fix Mail Queue Loop, Mail ::PORT missing variable 190 | 2022.09.01: Added ioctl() MTU readings to able to adjust bridge with bound device 191 | 2022.08.15: VNC proxy now quickier, but still no compression 192 | 2022.08.10: Highly optimized networking stack, running with much less CPU cycles while response time kick in. 193 | 2022.07.19: explode, implode, concat inner functions now uses C/C++ low level API with string pointers. 194 | 2022.07.11: stdin, stderr, stdout wont close on service mode while dont mess up the console 195 | 2022.06.02: framework upgrade, adaptive network stack with variable socketpool 196 | 2022.05.15: Fix MAC addresses are not applied on tap devices 197 | 198 | v.1.8.4-release 199 | 2022.03.30: Added Sata/Legacy (512B) HDD Option for instances those requires 512B physical sector size like MSSQL 200 | 2022.03.30: Adaptive Cache on VMs, removing and adding CDrom drives now will take affect on first boot. 201 | 202 | v.1.8.2-release 203 | 2022.03.07: Minor Version number added due a more frequent releases 204 | 2022.03.07: Hugely performance improvements on Windows Guests 205 | 2022.03.07: Performance Improvements on networking code 206 | 2022.03.07: Fixes UI glitches (mixing languages) 207 | 208 | v.1.8-release 209 | 2022.03.05: Newly added Network Card is enabled by default 210 | 2022.03.05: Fix backend throwing critical error when VM could not start properly (likely on special hardwares) 211 | 2022.03.05: Fix worker throwing error when node is disconnected while operating 212 | 2022.03.05: Added some default options when creating new VM 213 | 2022.03.05: Removed automatic boot & now the default behaviour restore last state 214 | 2022.03.05: Fix UI, incorrectly shows ISO images and deleted NICs 215 | 2022.03.06: UI Fixes and improvements 216 | 2022.03.06: Custom UEFI Firmware with BOOT delay and post message 217 | 2022.03.06: fixed error: "the index '4' does not exist" 218 | 219 | v.1.6-release 220 | 2022.02.01: Fixed wrong signature that caused the software could not start 221 | 2022.01.23: Fixed IPv4 & IPv6 Dual Stack caused session troubles 222 | 2022.01.23: Fixed bad SQL query on authlog, now displays actual entries in right order even if it has more than 500 entries 223 | 2022.01.23: Added a safe technique if the user IP flapping between IPv4 and IPv6 that was mostly caused websocket errors 224 | 2022.01.23: Fixed VNC/websocket connection when using proxy or VPN 225 | 226 | v.1.4-release 227 | 2021.12.22: Fixed some errors when hostname uppercase 228 | 2021.11.06: Fixed rare errors when multiple nodes added 229 | 2021.10.22: Fixed some errors when using wrong API commands 230 | 231 | v.1.2-release 232 | 2021.08.04: First Stable Release 233 | 2021.08.04: UI Improvements 234 | 235 | v.1.0-rc7 236 | 2021.07.20: Fixed broken [sysinfo] page, HTTP/500 237 | 238 | v.1.0-rc6 239 | 2021.07.19: VNC related network optimizations 240 | 2021.07.19: Now, Bhyve VNC Server listens only localhost 241 | 242 | v.1.0-rc5 243 | 2021.07.10: Security Fix: SQLite AUTO_INCREMENT behaviour allows newly created user to re-assign deleted user's IDs. 244 | 2021.07.10: Fix: Password stored wrong when new user created 245 | 2021.07.10: Enable user to modify: "Wait for Console", "Display", "RTC Clock", "Architecture", "Guest OS". 246 | 2021.07.10: Added version information on dashboard 247 | 2021.07.10: Newly created VMs are minimally preconfigured 248 | 2021.07.09: Added `RTC is UTC time` switch 249 | 2021.07.09: Fix: Notes and Journal inherited from deleted VMs when recreated with same prefix 250 | 2021.07.08: Removed IP Address at login splash, (security reason for using behind proxy) 251 | 2021.07.07: Added node prefetcher to avoid connection drops on huge latency 252 | 2021.07.06: Dashboard runs smoothly, lot of optimizations 253 | 2021.07.05: Fix: Config overwrite issues 254 | 2021.07.05: Upgraded framework, showing less informations on startup 255 | 2021.07.04: Fix: VM disk images wont deleted when not properly detached even if the VM is OFF and is on detaching state 256 | 2021.07.04: Fix: Networking issues that interfaces wont pull-up 257 | 2021.07.04: Fix: Modified startup scripts and binaries to avoid conditional-race between helper and backend 258 | 259 | v1.0-rc4 260 | 2021.06.30: Daily Release, tag: v1.0-rc4 261 | 2021.06.30: Fix: [Credit: VincentV@HUP]: The installer script may fails due missing /usr/local/etc/rc.d on fresh installs 262 | 2021.06.29: Hotfix Release: tag: v1.0-rc3 263 | 2021.06.29: Fixed prefix: allowing '_' char 264 | 2021.06.29: Daily Release, tag: v1.0-rc2 265 | 2021.06.28: Fixed 'sysinfo' hung up when one of the nodes is unavail. 266 | 2021.06.28: First release as release candidate 267 | -------------------------------------------------------------------------------- /Frontend/vmweb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaVieS007/bhyve-webadmin/c9e3144608beba7135428fadc8e295d80abfab30/Frontend/vmweb -------------------------------------------------------------------------------- /Helper/vmctl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaVieS007/bhyve-webadmin/c9e3144608beba7135428fadc8e295d80abfab30/Helper/vmctl -------------------------------------------------------------------------------- /Helper/vmctl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define true 1 10 | #define false 0 11 | typedef char bool; 12 | 13 | #define BHYVE_BIN "/usr/sbin/bhyve" 14 | 15 | bool writeFile(char *filename, char *data) 16 | { 17 | FILE *fp= NULL; 18 | fp = fopen (filename, "w+"); 19 | if(fp) 20 | { 21 | fputs(data,fp); 22 | fflush(fp); 23 | fclose(fp); 24 | return true; 25 | } 26 | 27 | return false; 28 | } 29 | 30 | bool appendFile(char *filename, char *data) 31 | { 32 | FILE *fp= NULL; 33 | fp = fopen (filename, "a+"); 34 | if(fp) 35 | { 36 | fputs(data,fp); 37 | fflush(fp); 38 | fclose(fp); 39 | return true; 40 | } 41 | 42 | return false; 43 | } 44 | 45 | /** IS_DIR **/ 46 | bool is_dir(char *path) 47 | { 48 | struct stat buf; 49 | if(stat(path, &buf) != 0) 50 | { 51 | return false; 52 | } 53 | 54 | return S_ISDIR(buf.st_mode); 55 | } 56 | /** IS_DIR **/ 57 | 58 | /** IS_FILE **/ 59 | bool is_file(char *path) 60 | { 61 | struct stat buf; 62 | if(stat(path, &buf) != 0) 63 | { 64 | return false; 65 | } 66 | 67 | return S_ISREG(buf.st_mode); 68 | } 69 | /** IS_FILE **/ 70 | 71 | 72 | int main(int argc, char* argv[]) 73 | { 74 | pid_t PID = 0; 75 | pid_t SID = 0; 76 | int rval = 0; 77 | 78 | char root_path[256]; 79 | char base_path[256]; 80 | char prefix[64]; 81 | char init_file[256]; 82 | 83 | char pid_file[256]; 84 | char log_file[256]; 85 | char res_file[256]; 86 | char buff[4096]; 87 | bool run = false; 88 | 89 | if(argc < 3) 90 | { 91 | fprintf(stderr,"BVCP BHYVE RUNNER Helper\nUsage: %s [root_path] [prefix]\n",argv[0]); 92 | exit(0); 93 | } 94 | 95 | if(strlen(argv[1]) > 170 || strlen(argv[2]) > 64) 96 | { 97 | fprintf(stderr,"Arguments Too Long!\n"); 98 | exit(2); 99 | } 100 | 101 | if(argc >= 4 && !strcmp(argv[3],"run")) 102 | { 103 | run = true; 104 | } 105 | 106 | 107 | root_path[0] = 0x00; 108 | strcat(root_path,argv[1]); 109 | 110 | prefix[0] = 0x00; 111 | strcat(prefix,argv[2]); 112 | 113 | base_path[0] = 0x00; 114 | sprintf(base_path,"%s/tmp/%s",root_path,prefix); 115 | 116 | init_file[0] = 0x00; 117 | sprintf(init_file,"%s/init",base_path); 118 | 119 | log_file[0] = 0x00; 120 | sprintf(log_file,"%s/log",base_path); 121 | 122 | 123 | if(run == true) 124 | { 125 | pid_file[0] = 0x00; 126 | sprintf(pid_file,"%s/vm.pid",base_path); 127 | } 128 | else 129 | { 130 | pid_file[0] = 0x00; 131 | sprintf(pid_file,"%s/ctl.pid",base_path); 132 | } 133 | 134 | res_file[0] = 0x00; 135 | sprintf(res_file,"%s/vm.exit",base_path); 136 | fprintf(stdout,"Root Path: %s\nBase Path: %s\nPrefix: %s\n",root_path,base_path,prefix); 137 | 138 | 139 | if(is_dir(base_path) == false) 140 | { 141 | fprintf(stderr,"Directory: %s, Non-exists!\n",base_path); 142 | exit(10); 143 | } 144 | 145 | if(is_file(init_file) == false) 146 | { 147 | fprintf(stderr,"File: %s, Non-exists!\n",init_file); 148 | exit(10); 149 | } 150 | 151 | if(!run) 152 | { 153 | PID = fork(); 154 | if (PID < 0) 155 | { 156 | fprintf(stderr,"Fork Failed!\n"); 157 | exit(2); 158 | } 159 | 160 | if (PID > 0) 161 | { 162 | buff[0] = 0x00; 163 | sprintf(buff,"%d",PID); 164 | writeFile(pid_file,buff); 165 | 166 | fprintf(stdout,"Started\n"); 167 | exit(0); 168 | } 169 | 170 | umask(0); 171 | SID = setsid(); 172 | if(SID < 0) 173 | { 174 | exit(1); 175 | } 176 | 177 | chdir(argv[1]); 178 | 179 | int fd = open(log_file, O_CREAT | O_WRONLY | O_TRUNC, 0600); 180 | if(fd) 181 | { 182 | dup2(fd, STDOUT_FILENO); // Check `man stdin` for more info 183 | dup2(fd, STDERR_FILENO); 184 | } 185 | 186 | close(STDIN_FILENO); 187 | /* 188 | close(STDOUT_FILENO); 189 | close(STDERR_FILENO); 190 | */ 191 | } 192 | 193 | 194 | if(run == true) 195 | { 196 | PID = getpid(); 197 | buff[0] = 0x00; 198 | sprintf(buff,"%d",PID); 199 | writeFile(pid_file,buff); 200 | 201 | FILE *fp = NULL; 202 | char line[256], *result; 203 | fp = fopen(init_file,"r"); 204 | buff[0] = 0x00; 205 | char *arr[256]; 206 | int c = 0; 207 | 208 | if(fp) 209 | { 210 | arr[c] = malloc(256); 211 | memset(arr[c],0,256); 212 | strcat(arr[c],BHYVE_BIN); 213 | fprintf(stderr,"[%d] %s\n",c,BHYVE_BIN); 214 | c++; 215 | 216 | while((result = fgets(line,255,fp)) != NULL) 217 | { 218 | line[strlen(line) - 1] = 0x00; 219 | arr[c] = malloc(256); 220 | memset(arr[c],0,256); 221 | strcat(arr[c],line); 222 | fprintf(stderr,"[%d] %s\n",c,line); 223 | c++; 224 | } 225 | arr[c] = NULL; 226 | fprintf(stderr,"\n\n"); 227 | 228 | execvp(BHYVE_BIN, arr); 229 | } 230 | } 231 | else 232 | { 233 | writeFile(res_file,"S"); 234 | buff[0] = 0x00; 235 | sprintf(buff,"%s %s %s run",argv[0],argv[1],argv[2]); 236 | rval = system(buff); 237 | 238 | buff[0] = 0x00; 239 | sprintf(buff,"%d",rval); 240 | 241 | writeFile(res_file,buff); 242 | writeFile(pid_file,""); 243 | } 244 | 245 | return (0); 246 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Please read this End User License Agreement (“EULA”) before You download / purchase / use BVCP Software. 2 | 3 | By purchasing a License Key and/or downloading and using the BVCP Application, You agree, without reservation to be bound by the terms of this EULA. If You do not agree with the terms of this EULA, please do not purchase a License Key and/or download and use the BVCP Application. 4 | 5 | If You accept the terms and conditions in this EULA on behalf of a company or other legal entity, You warrant that You have full legal authority to accept the terms and conditions in this EULA on behalf of such company or other legal entity, and to legally bind such company or other legal entity. 6 | 7 | You may not accept this EULA if You are not of legal age to form a binding contract with about BVCP Application and with it's legal owner. 8 | 9 | Definitions 10 | In this EULA the expressions below shall have the meaning assigned to them in this clause, unless the context requires otherwise: 11 | 12 | “Documentation” the detailed information about the BVCP Application, its features and the system requirements as made available on the website of BVCP Application, as amended from time to time; 13 | 14 | ”BVCP Application” that our software application, Bhyve Virtual-Machine Control Panel. 15 | 16 | ”Author” the legal owner of this product as intellectual property, Viktor Hlavaji, Budapest Hungary, Kisvarda str. 11, VAT: 56532454-1-42 17 | 18 | General 19 | This EULA applies to any licenses granted to You by the Author for the use of the BVCP Application. 20 | By purchasing a License Key for the BVCP Application and/or downloading and using the BVCP Application, You enter into this EULA with the Author. 21 | This EULA may be modified from time to time. The Author will notify you of such modifications on its website or otherwise, e.g. by using the email address used for contact with the Author. 22 | 23 | License 24 | The Author grants You a non-exclusive, non-transferable, non-sublicensable, limited, revocable license to Use the BVCP Application in accordance with this EULA. The Author reserves all rights not expressly granted to You. 25 | Author is and remains the owner of any intellectual property rights with respect to the BVCP Application. You shall not acquire any ownership to the BVCP Application as result of Your purchase of the License Key or Your Use of the BVCP Application as Free-Of-Charge. 26 | 27 | Permitted use and restrictions 28 | In order to be able to install the BVCP Application and receive Updates and upgrades, Your computer shall have access to the Internet and shall meet the system requirements described in the Documentation that can be found on the webpage: https://bhyve.npulse.net. 29 | 30 | Multiple licensing options 31 | The Author might issue licenses with custom terms, this license is refers for the community edition of the BVCP Application which is free-of-charge. 32 | 33 | Free-Of-Charge: 34 | BVCP Application is available of free-of-charge without any limitation with its usage and features and the software comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. 35 | The software comes without official support, please bear in mind this is a community edition. 36 | The Author reserves the right that implement premium and paid addons in the future without limiting the existing functions and without any notification, and the end-user must accept and subscribe before charged. 37 | 38 | You are not limited how and how many of BVCP Application you are running but You shall Use the BVCP Application in accordance with applicable laws and shall not: 39 | 40 | rent, lease, lend, sell, redistribute, sublicense or otherwise commercially exploit the Software itself; 41 | assign the License / License Key or the BVCP Application License without prior written approval of the Author; 42 | 43 | Use the BVCP Application for any unlawful or illegal activity, or to facilitate an unlawful or illegal activity; 44 | delete or alter any disclaimers, warnings, copyright or other proprietary notices accompanying the BVCP Application; or 45 | copy (except as otherwise provided in this EULA), adapt, translate, decompile, reverse engineer, disassemble, attempt to derive the source code of, modify or create derivative works of the BVCP Application and the License Key or any parts thereof, except to the extent permitted by applicable law. 46 | 47 | The Author may modify the BVCP Application at any time at its sole discretion and without notice to You, for example to comply with applicable law or a court order, to avoid a third party infringement claim or to provide Updates and upgrades. 48 | 49 | Certain components of the BVCP Application are Open Source Software and licensed under the terms of the applicable license(s) of the Open Source Software. You shall adhere to these terms and conditions, which can be found via the webpage. 50 | 51 | Maintenance and support 52 | The Software intended for system administrators who knows what they are doing, therefore regarding this license type, this is a self-hosted application and it's maintenance is up to end-user. 53 | 54 | Use of data 55 | The Author and its subsidiaries may periodically collect and use technical and related data concerning the BVCP Application, including about the version number, errorlog of the BVCP Application You have installed and about the system You have installed the BVCP Application on. The Author will use such data to facilitate maintenance and support with respect to the BVCP Application, to improve its products and to provide further services or technologies to You. 56 | 57 | The Author may process personal data with respect to You, if and to the extent necessary to provide maintenance and support to You with respect to the BVCP Application and to comply with its obligations under this EULA. To the extent the Author will process personal data, it will comply with its obligations under applicable data protection law. Please see our privacy statement for more details on the processing of Your personal data that the Author has collected and received through its website. 58 | 59 | Disclaimer 60 | You Use the BVCP Application at Your own risk and the entire risk as to satisfactory quality, performance and accuracy is with You. 61 | The BVCP Application and accompanying documentation are provided on an “as is” and “as available” basis without warranty - express or implied - of any kind, and The Author specifically disclaims the warranty of fitness for a particular purpose. No oral or written advice given by the Author, its dealers, distributors, agents or employees shall create a warranty or in any way increase the scope of this warranty and You may not rely upon such information or advice. 62 | 63 | Liability limitation 64 | The liability of the Author and any third party that has been involved in the creation, production, or delivery of the BVCP Application for all damages arising out of or in any way relating to the any paid components of BVCP Application, and/or the License Key, the BVCP Application and/or this EULA shall in no event exceed the total amount(s) paid by You to the Author in the preceding 12 (twelve) months. 65 | 66 | The Author and any third party that has been involved in the creation, production, or delivery of the BVCP Application are under no circumstances liable for consequential or indirect damages (including damage for loss of profit, business interruption, loss of data, and the like arising out of the use or inability to use the BVCP Application). 67 | 68 | Termination 69 | This EULA will continue to be in force until it is revoked by the Author itself. 70 | 71 | 72 | This EULA shall be governed by and construed in accordance with the laws of the Hungary, excluding its conflicts of law rules. 73 | Any dispute between the Author and You shall exclusively be submitted to the competent court in The Budapest, Hungary. 74 | 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BVCP Application (Bhyve Virtual-Machine Control Panel) 2 | 3 | **Current Version: 2.1.x-Release** 4 | 5 | ## In Nutshell 6 | BVCP is a graphical and secure webcontrol panel for FreeBSD Bhyve's Virtual Machines. 7 | BVCP is made with love and for enterprise use, 24/7 NON-STOP operation, tested on production enterprise-class area. 8 | Unlike many others, BVCP is just a native application/software for FreeBSD with a one-click-install feature. 9 | BVCP is shall not interfere or modify your system settings it can be run at most of environments. 10 | BVCP can handle more physical hosts with one interface without clustering. 11 | Fun Fact: The software made within 4 months. 12 | 13 | ## Introduction 14 | This is a personal project from the author of nPulse.net, Viktor Hlavaji (DaVieS). 15 | nPulse.net is always willing to share knowledge and resources with others, and I have 10+ experience of making industry-class / enterprise-class softwares. 16 | 17 | It does have a Graphical user Interface via webinterface and also a CLI and an API. 18 | The software provides webGUI to let you manage Virtual Machines remotely. 19 | 20 | The software is uses our framework "Kinga Framework" which is used in various enterprise-class products already since 2017. 21 | Mostly written in C/C++. 22 | The software has its components: 23 | - Frontend (Web Interface) 24 | - Backend (Worker) 25 | - Helper 26 | - Utils 27 | 28 | Please refer to the website for more informations: [bhyve.npulse.net](https://bhyve.npulse.net) 29 | 30 | ## ScreenShots 31 | API CLI Interface Login Area 32 | Running Windows VM GUI Looklike 33 | Running Linux VM Dashboard 34 | 35 | ## Bhyve 36 | Bhyve is a hypervisor of FreeBSD, this software requires that and FreeBSD 12+. 37 | 38 | ## License: Community Free-Of-Charge Edition 39 | - You can download, install and use the BVCP Application for without any charges and limitations including commercial. 40 | - You can not modify the binaries, disassemble the binaries, resell the software, redistribute the software, etc.. 41 | - You are allowed to upload screenshots and videos from the application itself in purpose of documentation, tutorial, HOWTOs 42 | - Please refer to the LICENSE for more informations. 43 | 44 | ## Installation 45 | ### Minimum Requirements 46 | - At least a FreeBSD 12+ installed onto your target machine with virtualisation capable amd64 architecture. 47 | - Minimum 250MB of free space on /var/lib for the binaries 48 | - Network interface 49 | 50 | #### 1) Log in to your FreeBSD Box and bring-up a root shell 51 | root@vmhost:~ # 52 | 53 | #### 2) Download the latest release 54 | `fetch https://bhyve.npulse.net/release.tgz` or download manually from (this) github page 55 | 56 | #### 3) Extract the archive you have downloaded 57 | `tar -xzvf release.tgz` 58 | ```` 59 | x bhyve-webadmin/ 60 | x bhyve-webadmin/utils/ 61 | x bhyve-webadmin/API/ 62 | x bhyve-webadmin/install.sh 63 | x bhyve-webadmin/Frontend/ 64 | x bhyve-webadmin/.git/ 65 | x bhyve-webadmin/Backend/ 66 | x bhyve-webadmin/update.sh 67 | x bhyve-webadmin/Helper/ 68 | x bhyve-webadmin/Helper/vmctl 69 | ... 70 | ```` 71 | 72 | #### 4) Enter `bhyve-webadmin` and run `install.sh` 73 | root@vmhost:~# `cd bhyve-webadmin && ./install.sh` 74 | 75 | ```` 76 | Installing BVCP into your FreeBSD Installation within seconds ... 77 | 78 | Press [CTRL] + [C] to Abort ! 79 | ... 80 | 81 | ██████╗ ██╗ ██╗ ██████╗██████╗ 82 | ██╔══██╗██║ ██║██╔════╝██╔══██╗ 83 | ██████╔╝██║ ██║██║ ██████╔╝ 84 | ██╔══██╗╚██╗ ██╔╝██║ ██╔═══╝ 85 | ██████╔╝ ╚████╔╝ ╚██████╗██║ 86 | ╚═════╝ ╚═══╝ ╚═════╝╚═╝ 87 | 88 | Bhyve Virtual-Machine Control Panel under FreeBSD 89 | [N] 2021-06-26 22:16:56 | application/vmserver/main.c | Initialising bhyve VM Server Application 90 | 91 | (+) The Software is producing pseudo filesystem scheme for virtual machines using symlinks 92 | Where to create metadata, iso_images, database, config, logs: (Does not need much space), default: [/vms]_> 93 | ```` 94 | #### 5) Enter a path (default: /vms) where some misc data placed, but not for storing virtual disks!! 95 | ```` 96 | ... 97 | (!) Admin Credentials recreated, 98 | - User: admin 99 | - Password: AXN3jtPt 100 | 101 | [N] 2021-06-26 22:28:00 | SW | Program exited gracefully... 102 | Installation Finished! 103 | Navigate: https://[your-ip]:8086 104 | ```` 105 | 106 | #### 6) Installation is should be done, please write down your initial credentials and try access at `https://[your-ip]:8086` 107 | #### 7) Please log-in and manage your account settings, before creation of any VM, please ensure you have added Storage and Network for the VM. 108 | 109 | 110 | ## API Interface 111 | ### General 112 | ```` 113 | 114 | ██████╗ ██╗ ██╗ ██████╗██████╗ 115 | ██╔══██╗██║ ██║██╔════╝██╔══██╗ 116 | ██████╔╝██║ ██║██║ ██████╔╝ 117 | ██╔══██╗╚██╗ ██╔╝██║ ██╔═══╝ 118 | ██████╔╝ ╚████╔╝ ╚██████╗██║ 119 | ╚═════╝ ╚═══╝ ╚═════╝╚═╝ 120 | 121 | Bhyve Virtual-Machine Control Panel under FreeBSD 122 | 123 | [N] 2021-06-28 03:04:17 | application/vmserver/main.c | Initialising bhyve VM Server Application 124 | Error: / ERR / invalid_parameter 125 | Available Commands: 126 | + vm | Virtual Machine Management 127 | + storage | Storage Management 128 | + switch | Virtual Switch Management 129 | + user | Built-in User Management 130 | + vminfo | SysInfo 131 | + config | Internal Storage 132 | 133 | more details: vm 134 | cmd example: vm list ALL 135 | Note: type exit to Quit 136 | 137 | _> 138 | ```` 139 | 140 | ### VM Submenu 141 | ```` 142 | _> vm 143 | * [vm] Available Commands: 144 | [Start/Stop Commands] 145 | + start [prefix] | Start virtual machine 146 | + check [prefix] | Check virtual machine 147 | + shutdown [prefix] | ACPI Shutdown 148 | + user [user] | Add user to the VM 149 | + log [prefix] [max_entries] | Fetch VM Journal 150 | + kill [prefix] | Kill virtual machine 151 | + stop [prefix] | Stop virtual machine 152 | + list {prefix} | List virtual machine 153 | + destroy {prefix} | Destroy virtual machine 154 | + restart [prefix] | Restart virtual machine 155 | 156 | [Management Commands] 157 | + create [prefix] [description] | New virtual machine 158 | + desc [prefix] [new_description] | Modify virtual machine 159 | + note [prefix] {new_note} | Add/Get note 160 | + clear [prefix] | Clear config (debug purpose) 161 | + set [prefix] [key] [value] | Set core variables 162 | - keys: cpu.socket, cpu.core, memory, sys[linux,win,bsd] arch[intel,amd] 163 | - keys: auto.boot, vnc.wait 164 | - destroy [prefix] | Destroy virtual machine 165 | + list | List virtual machine 166 | 167 | [Disk Management Commands] 168 | + disk create [prefix] [storage] [name] [size] | Create new disk 169 | + disk attach [prefix] [file] [desc] [slot] [ahci/virtio] | Attach Disk into VM 170 | + disk detach [prefix] [file] | Detach Disk from VM 171 | + disk destroy [prefix] [ID/file] | Delete Disk 172 | + disk resize [prefix] [file] [new_size] | Resize Disk 173 | + disk list [prefix] | List Disks 174 | 175 | [CDROM Commands] 176 | + cdrom attach [prefix] [iso_file] | Attach ISO file as CD-ROM 177 | + cdrom detach [prefix] [iso_file] | Detach ISO 178 | + cdrom list [prefix] | List ISO Images 179 | 180 | [Network Commands] 181 | + nic add_virtio [prefix] [switch] {mac_addr} | Add VirtIO/NIC bound to switch 182 | + nic add_legacy [prefix] [switch] {mac_addr} | Add Intel/NIC bound to switch 183 | + nic change [prefix] [NIC] [switch] | Change Switch 184 | + nic enable [prefix] [NIC] | Enable NIC 185 | + nic disable [prefix] [NIC] | Disable NIC 186 | + nic remove [prefix] [NIC] | Remove NIC 187 | + nic list [prefix] | List Interfaces 188 | ```` 189 | 190 | ### Storage Submenu 191 | ```` 192 | _> storage 193 | * [storage] Available Commands: 194 | [Basic Commands] 195 | + list {active} | List Storages 196 | + create [mountpoint] [description] | Enable new storage 197 | + modify [mountpoint] [desc] {enable/disable} | Modify existing storage 198 | + destroy [mountpoint] | Destroy Storage 199 | ```` 200 | 201 | ### Switch Submenu 202 | ```` 203 | _> switch 204 | * [switch] Available Commands: 205 | [Basic Commands] 206 | + create [prefix] [description] | Create new vSwitch 207 | + destroy [prefix] | Destroy vSwitch 208 | + desc [prefix] [description] | Rename vSwitch 209 | + reload | Reload Configuration 210 | + cleanup | Clear OS configuration 211 | + bound [prefix] [iface] | Bound to network interface 212 | + unbound [prefix] | UnBound from network interface 213 | + list | List vSwitch 214 | + listDevs | List Network Cards 215 | ```` 216 | 217 | ### Switch Submenu 218 | ```` 219 | _> user 220 | * [user] Available Commands: 221 | + ipinfo [ip_addr] | Show IP Geo Info 222 | + fetch [userID/mail/ALL] | Get list of user(s) 223 | + logauth [mail] [TYPE] [IP] [CUID] [EXT] | Log Authentication 224 | + authlog [mail/ALL] | Retrieve Authentication Logs 225 | + change [mail/ID] [new_name] [new_mail] [new_password (optional)] | Modify User Settings 226 | + role [mail/ID] [USER/ADMIN] | Modify User Role 227 | + create [name] [mail] [passwd] | Create new user account 228 | + delete [mail/userID] | Dele 229 | ```` 230 | 231 | ### Config Submenu 232 | ```` 233 | _> config 234 | * [config] Available Commands: 235 | [Basic Commands] 236 | + set [key] [value] | Set config variable 237 | + get [key] | Get config variable 238 | + del [key] | Delete config variable 239 | ```` 240 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | clear 4 | echo "Installing BVCP into your FreeBSD Installation within seconds ..." 5 | echo "" 6 | echo "Press [CTRL] + [C] to Abort !" 7 | sleep 5 8 | 9 | mkdir -p /usr/local/etc/rc.d 10 | mkdir -p /var/lib/nPulse/BVCP 11 | cp -R ./API/ /var/lib/nPulse/BVCP/API/ 12 | cp -R ./Backend/ /var/lib/nPulse/BVCP/Backend/ 13 | cp -R ./Frontend/ /var/lib/nPulse/BVCP/Frontend/ 14 | cp -R ./Helper/ /var/lib/nPulse/BVCP/Helper/ 15 | 16 | cp ./utils/bvcp-backend /usr/local/etc/rc.d/bvcp-backend 17 | cp ./utils/bvcp-frontend /usr/local/etc/rc.d/bvcp-frontend 18 | cp ./utils/bvcp-helper /usr/local/etc/rc.d/bvcp-helper 19 | sysrc bvcp_enable="YES" 20 | 21 | cd /var/lib/nPulse/BVCP/Helper 22 | clang -o vmctl vmctl.c 23 | 24 | cd ../Backend/ 25 | ./vmm setup 26 | 27 | service bvcp-backend restart 28 | service bvcp-helper restart 29 | service bvcp-frontend restart 30 | 31 | clear 32 | /var/lib/nPulse/BVCP/Backend/vmm reset_password 33 | echo "Installation Finished!" 34 | echo "Navigate: https://[your-ip]:8086" 35 | sleep 10 36 | -------------------------------------------------------------------------------- /screenshots/scr587.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaVieS007/bhyve-webadmin/c9e3144608beba7135428fadc8e295d80abfab30/screenshots/scr587.png -------------------------------------------------------------------------------- /screenshots/scr589.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaVieS007/bhyve-webadmin/c9e3144608beba7135428fadc8e295d80abfab30/screenshots/scr589.png -------------------------------------------------------------------------------- /screenshots/scr590.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaVieS007/bhyve-webadmin/c9e3144608beba7135428fadc8e295d80abfab30/screenshots/scr590.png -------------------------------------------------------------------------------- /screenshots/scr592.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaVieS007/bhyve-webadmin/c9e3144608beba7135428fadc8e295d80abfab30/screenshots/scr592.png -------------------------------------------------------------------------------- /screenshots/scr597.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaVieS007/bhyve-webadmin/c9e3144608beba7135428fadc8e295d80abfab30/screenshots/scr597.png -------------------------------------------------------------------------------- /screenshots/scr599.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaVieS007/bhyve-webadmin/c9e3144608beba7135428fadc8e295d80abfab30/screenshots/scr599.png -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | clear 4 | echo "Updating BVCP ..." 5 | echo "" 6 | echo "Press [CTRL] + [C] to Abort !" 7 | sleep 5 8 | 9 | service bvcp-frontend stop 10 | service bvcp-helper stop 11 | service bvcp-backend stop 12 | 13 | cp -R ./API/ /var/lib/nPulse/BVCP/API/ 14 | cp -R ./Backend/ /var/lib/nPulse/BVCP/Backend/ 15 | cp -R ./Frontend/ /var/lib/nPulse/BVCP/Frontend/ 16 | cp -R ./Helper/ /var/lib/nPulse/BVCP/Helper/ 17 | 18 | cp ./utils/bvcp-backend /usr/local/etc/rc.d/bvcp-backend 19 | cp ./utils/bvcp-frontend /usr/local/etc/rc.d/bvcp-frontend 20 | cp ./utils/bvcp-helper /usr/local/etc/rc.d/bvcp-helper 21 | 22 | cd /var/lib/nPulse/BVCP/Helper 23 | rm -f ./vmctl.old 24 | mv ./vmctl vmctl.old 25 | chmod 644 ./vmctl.old 26 | clang -o vmctl vmctl.c 27 | 28 | service bvcp-backend start 29 | service bvcp-helper start 30 | service bvcp-frontend start 31 | 32 | echo "Update Finished!" 33 | sleep 10 34 | -------------------------------------------------------------------------------- /utils/bvcp-backend: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $FreeBSD: 2021.06.15 4 | # 5 | 6 | # PROVIDE: bvcp-backend 7 | # REQUIRE: NETWORKING SERVERS 8 | # BEFORE: DAEMON 9 | # KEYWORD: shutdown 10 | 11 | # 12 | # Add the following lines to /etc/rc.conf to enable trackit-client: 13 | # 14 | # bvcp_enable="YES" 15 | # 16 | # 17 | 18 | . /etc/rc.subr 19 | 20 | name=bvcp 21 | rcvar=bvcp_enable 22 | 23 | # read settings, set default values 24 | load_rc_config "$name" 25 | 26 | : ${bvcp_enable:=NO} 27 | 28 | command=/var/lib/nPulse/BVCP/Backend/vmm 29 | required_dirs=/var/lib/nPulse/BVCP/Backend 30 | required_files=/var/lib/nPulse/BVCP/Backend/vmm 31 | start_cmd="$command --daemon /var/lib/nPulse/BVCP/Backend/ /var/run/bvcp-backend.pid backend" 32 | 33 | start_precmd= 34 | reload_cmd= 35 | pidfile=/var/run/bvcp-backend.pid 36 | 37 | run_rc_command "$1" 38 | -------------------------------------------------------------------------------- /utils/bvcp-frontend: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $FreeBSD: 2021.06.15 4 | # 5 | 6 | # PROVIDE: bvcp-frontend 7 | # REQUIRE: bvcp-helper 8 | # BEFORE: DAEMON 9 | # KEYWORD: shutdown 10 | 11 | # 12 | # Add the following lines to /etc/rc.conf to enable trackit-client: 13 | # 14 | # bvcp_enable="YES" 15 | # 16 | # 17 | 18 | . /etc/rc.subr 19 | 20 | name=bvcp 21 | rcvar=bvcp_enable 22 | 23 | # read settings, set default values 24 | load_rc_config "$name" 25 | 26 | : ${bvcp_enable:=NO} 27 | 28 | command=/var/lib/nPulse/BVCP/Frontend/vmweb 29 | required_dirs=/var/lib/nPulse/BVCP/Frontend 30 | required_files=/var/lib/nPulse/BVCP/Frontend/vmweb 31 | start_cmd="$command --daemon /var/lib/nPulse/BVCP/Frontend/ /var/run/bvcp-frontend.pid" 32 | 33 | start_precmd= 34 | reload_cmd= 35 | pidfile=/var/run/bvcp-frontend.pid 36 | 37 | run_rc_command "$1" 38 | -------------------------------------------------------------------------------- /utils/bvcp-helper: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $FreeBSD: 2021.06.15 4 | # 5 | 6 | # PROVIDE: bvcp-helper 7 | # REQUIRE: bvcp-backend 8 | # BEFORE: DAEMON 9 | # KEYWORD: shutdown 10 | 11 | # 12 | # Add the following lines to /etc/rc.conf to enable trackit-client: 13 | # 14 | # bvcp_enable="YES" 15 | # 16 | # 17 | 18 | . /etc/rc.subr 19 | 20 | name=bvcp 21 | rcvar=bvcp_enable 22 | 23 | # read settings, set default values 24 | load_rc_config "$name" 25 | 26 | : ${bvcp_enable:=NO} 27 | 28 | start_precmd="bvcp_prestart" 29 | 30 | #/usr/sbin/service bvcp-backend status || err 4 "BVCP Backend is not running yet" 31 | 32 | command=/var/lib/nPulse/BVCP/Backend/vmm 33 | required_dirs=/var/lib/nPulse/BVCP/Backend 34 | required_files=/var/lib/nPulse/BVCP/Backend/vmm 35 | start_cmd="$command --daemon /var/lib/nPulse/BVCP/Backend /var/run/bvcp-helper.pid helper" 36 | 37 | start_precmd= 38 | reload_cmd= 39 | pidfile=/var/run/bvcp-helper.pid 40 | 41 | run_rc_command "$1" 42 | --------------------------------------------------------------------------------