mirror of
https://github.com/gryf/boxpy.git
synced 2025-12-18 13:00:17 +01:00
Use predefined os types for vbox VMs.
It might have impact on how operating system inside VM is treated by VirtualBox, so let's stick with proper distro for every OS. As an outcome, it turns out, that for graphical side of the vm, for Linux OS the vmsvga driver is recommended, as a little more amount of vram.
This commit is contained in:
18
box.py
18
box.py
@@ -585,6 +585,14 @@ class Config:
|
||||
return source
|
||||
|
||||
|
||||
class OsTypes:
|
||||
def ubuntu(conf):
|
||||
return "Ubuntu%s_64" % conf.version.replace('.', '_')
|
||||
|
||||
def fedora(conf):
|
||||
return "Fedora_64"
|
||||
|
||||
|
||||
class VBoxManage:
|
||||
"""
|
||||
Class for dealing with vboxmanage commands
|
||||
@@ -765,7 +773,15 @@ class VBoxManage:
|
||||
'--acpi', 'on',
|
||||
'--audio', 'none',
|
||||
'--nic1', 'nat',
|
||||
'--natpf1', f'boxpyssh,tcp,,{port},,22']
|
||||
'--natpf1', f'boxpyssh,tcp,,{port},,22',
|
||||
'--graphicscontroller', 'vmsvga',
|
||||
'--vram', '16']
|
||||
|
||||
if hasattr(OsTypes, conf.distro):
|
||||
cmd.extend(['--ostype', getattr(OsTypes, conf.distro)(conf)])
|
||||
else:
|
||||
cmd.extend(['--ostype', 'Linux_64'])
|
||||
|
||||
for count, (hostport, vmport) in enumerate(conf.forwarding.items(),
|
||||
start=1):
|
||||
cmd.extend(['--natpf1', f'custom-pf-{count},tcp,,{hostport},'
|
||||
|
||||
Reference in New Issue
Block a user