English | Lietuviškai

Info


Communication


PEROPESIS FORUM

This forum is dedicated to discussing issues related to the use and development of the Peropesis Linux operating system.

Thoughts about importing a package manager

by g, Monday, November 14, 2022, 12:18 (738 days ago) @ sskras

With the shell script you wrote, it looks like Peropesis 1.8 works. I've changed some VM options a little bit:


#!/bin/bash
#
# SPDX-FileCopyrightText: 2022 Saulius Krasuckas <saulius2@ar-fi.lt> | sskras
# SPDX-License-Identifier: BlueOak-1.0.0
# SPDX-FileContributor: Modified by Gediminas Mockus <info(at)peropesis.org>
#
ISO_URL="https://peropesis.org/peropesis/Peropesis-1.8-live.iso"
VM_NAME="SuperMachine"
OS_TYPE="Linux_64"
SATA_NAME="SATA"
ISO_FILE="Peropesis-*-live.iso"

function print () {
echo
echo $*
echo
}

function colorize () {
cat - | grep --color -e "^" "$@"
}

print - Retrieving:
wget -nv --show-progress -c --content-disposition ${ISO_URL}
ls -l "${ISO_FILE}"

print - Creating VM:
VBoxManage list vms
VBoxManage createvm --name ${VM_NAME} --ostype ${OS_TYPE} --register | colorize -e ${VM_NAME}

print - Listing VMs:
VBoxManage list vms | colorize -e ${VM_NAME}

print - VM current settings:
VBoxManage showvminfo ${VM_NAME}

print - Set some VM options:
VBoxManage modifyvm ${VM_NAME} --cpus 2 --memory 512 --vram 12

print - Changed VM settings:
VBoxManage showvminfo ${VM_NAME} | grep "Memory size" | colorize -e '[0-9MB]$' -e ''

print - Configuring a Virtual Network Adapter
VBoxManage modifyvm ${VM_NAME} --nic1 bridged --bridgeadapter1 eth0

print - Adding SATA:
VBoxManage storagectl ${VM_NAME} --name ${SATA_NAME} --add sata --portcount 2 --bootable on
VBoxManage showvminfo ${VM_NAME} | grep -i storage | colorize -e ${SATA_NAME}

print - Attaching ISO:
VBoxManage storageattach ${VM_NAME} --storagectl ${SATA_NAME} --port 0 --device 0 --type dvddrive --medium ${ISO_FILE}
VBoxManage showvminfo --details ${VM_NAME} | grep "^${SATA_NAME}" | colorize -e ${SATA_NAME} -e "${ISO_FILE}"

print - VM net config:
VBoxManage showvminfo ${VM_NAME} | awk '/^NIC/ && !/^NIC .* disabled/' | colorize -e "^NIC \+[0-9]\+" -e "MAC: [^,]\+" -e "Type: [^,]\+"

print - Starting VM:
VBoxManage startvm ${VM_NAME} | colorize -e ${VM_NAME}

print "Press <Enter> to finish"
read

print - Powering VM off:
VBoxManage controlvm ${VM_NAME} poweroff
until $(VBoxManage showvminfo ${VM_NAME} | grep -q powered.off); do echo -n "."; sleep 1; done; sleep 2

print - Destroying VM:
VBoxManage unregistervm ${VM_NAME} --delete

print - Listing VMs:
VBoxManage list vms

exit
#
#The end
#


Could I add this script to the user manual, creating a new chapter named: "Peropesis live booting by using managing VirtuaBox from CLI"?


Complete thread:

 


Copyright © 2021-2024 Peropesis. See license terms.
E-mail: info(at)peropesis.org