vmmaker/classes/linux.py
Kumi b09bec7a70
feat: start implementing VM editing and configuration
Introduced a new set of Python classes under `classes/` directory,
enabling functionality to edit and configure virtual machines (VMs)
through a text-based user interface (TUI). Key components include
handling for Linux distribution-specific configurations, partition
mounting, and VM disk manipulation using QEMU tools. This structure
allows for scalable VM management tasks such as user modification,
network configuration, hostname setting, and disk conversion from VMDK
to raw image format.

Additionally, basic infrastructure such as `.gitignore`, `README.md`,
and `requirements.txt` setup is included to ensure a clean development
environment and provide necessary instructions and dependencies for
running the script.

The TUI, powered by npyscreen, facilitates user interaction for
configuring newly cloned VMs, focusing on ease of use and automation of
repetitive tasks.

This comprehensive suite marks a pivotal step towards automating VM
management and customization processes, significantly reducing manual
overhead for system administrators and developers dealing with virtual
environments.
2024-03-29 13:54:37 +01:00

28 lines
711 B
Python

from abc import ABC, abstractmethod
class LinuxDistroHandler(ABC):
@abstractmethod
def list_modify_users(self, mount_point):
pass
@abstractmethod
def configure_networking(self, mount_point):
pass
@abstractmethod
def set_hostname(self, mount_point, hostname):
pass
class GenericLinuxHandler(LinuxDistroHandler):
def list_modify_users(self, mount_point):
# TODO: List /etc/passwd contents and allow modifications
pass
def configure_networking(self, mount_point):
# TODO: Allow network interface configuration
pass
def set_hostname(self, mount_point, hostname):
# TODO: Set the system hostname
pass