FreeVM-Server-KVM/start-linux.js

10 lines
452 B
JavaScript
Raw Normal View History

2024-09-20 15:26:05 -04:00
const http = require('http');
const child = require("child_process");
2024-09-20 15:32:13 -04:00
let makedisk = "qemu-img create vm.img 30G" // make a 30GB disk
2024-09-20 15:29:15 -04:00
let qemucmd = "qemu-system-x86_64 -vnc :1 -m 1G"
2024-09-20 15:32:13 -04:00
child.execSync(makedisk)
2024-09-20 15:29:30 -04:00
child.execSync(qemucmd)
2024-09-20 15:26:05 -04:00
http.createServer(function (req, res) {
2024-09-20 15:29:15 -04:00
res.write('Server running at IP 127.0.0.1:5901 (VNC)'); //write a response to the client
2024-09-20 15:26:05 -04:00
res.end(); //end the response
}).listen(8080); //the server object listens on port 8080