Virtual Box

Virtual Box

Introduction

基本設定

  • 安裝 virtual box
    • 新增虛擬機器
      • 設定 os
      • 設定 memery size
      • 設定檔案位置和大小
    • 啟動
      • ubuntu
        • 官網下載 iso 安裝檔
        • 選取下載的 iso 檔安裝 ubuntu
        • 安裝 ubuntu
          • 在VirtualBox虛擬環境調整Ubuntu系統的螢幕解析度
            • tool bar 上的裝置 -> 插入 Guest Additions CD 映像檔
            • 再重新啟動後,可以調整視窗的大小
            • 不然視窗大小一直不能調整
      • window

        move the default position of machine

        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
        21
        22
        23
        24
        25
        26
        27
        28
        29
        30
        31
        32
        33
        34
        35
        36
        37
        38
        39
        40
        // ${homedir()}/.VirtualBox/VirtualBox.xml
        <?xml version="1.0"?>
        <!--
        ** DO NOT EDIT THIS FILE.
        ** If you make changes to this file while any VirtualBox related application
        ** is running, your changes will be overwritten later, without taking effect.
        ** Use VBoxManage or the VirtualBox Manager GUI to make changes.
        -->
        <VirtualBox xmlns="http://www.virtualbox.org/" version="1.12-windows">
        <Global>
        <ExtraData>
        <ExtraDataItem name="GUI/Details/Elements" value="general,system,preview,display,storage,audio,network,usb,sharedFolders,description"/>
        <ExtraDataItem name="GUI/GroupDefinitions/" value="nf=GLOBAL,m=7b720d67-dcdf-435e-8a69-b07000f0dc5a"/>
        <ExtraDataItem name="GUI/LastItemSelected" value="m=Linux"/>
        <ExtraDataItem name="GUI/LastWindowPosition" value="480,257,960,515"/>
        <ExtraDataItem name="GUI/MaxGuestResolution" value="1080,480"/>
        <ExtraDataItem name="GUI/RecentFolderCD" value="C:/Users/LinYu/Downloads"/>
        <ExtraDataItem name="GUI/RecentListCD" value="C:\Users\LinYu\Downloads\ubuntu-20.04.1-desktop-amd64.iso"/>
        <ExtraDataItem name="GUI/SplitterSizes" value="319,640"/>
        <ExtraDataItem name="GUI/Tools/LastItemsSelected" value="Welcome,Details"/>
        <ExtraDataItem name="GUI/UpdateCheckCount" value="3"/>
        <ExtraDataItem name="GUI/UpdateDate" value="1 d, 2020-10-15, stable, 6.1.14"/>
        <ExtraDataItem name="HostOnly/{24c8342f-ff06-452f-aeb5-ccd6c1ea1cf2}/IPAddress" value="192.168.56.1"/>
        <ExtraDataItem name="HostOnly/{24c8342f-ff06-452f-aeb5-ccd6c1ea1cf2}/IPNetMask" value="255.255.255.0"/>
        <ExtraDataItem name="HostOnly/{24c8342f-ff06-452f-aeb5-ccd6c1ea1cf2}/IPV6Address" value="fe80::2125:2d7d:d367:8975"/>
        <ExtraDataItem name="HostOnly/{24c8342f-ff06-452f-aeb5-ccd6c1ea1cf2}/IPV6PrefixLen" value="64"/>
        <ExtraDataItem name="HostOnly/{24c8342f-ff06-452f-aeb5-ccd6c1ea1cf2}/Name" value="VirtualBox Host-Only Ethernet Adapter"/>
        </ExtraData>
        <MachineRegistry>
        <MachineEntry uuid="{7b720d67-dcdf-435e-8a69-b07000f0dc5a}" src="D:\VirtualBox VMs\Linux\Linux.vbox"/>
        </MachineRegistry>
        <NetserviceRegistry>
        <DHCPServers>
        <DHCPServer networkName="HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter" IPAddress="192.168.56.100" networkMask="255.255.255.0" lowerIP="192.168.56.101" upperIP="192.168.56.254" enabled="1"/>
        </DHCPServers>
        </NetserviceRegistry>
        <SystemProperties defaultMachineFolder="D:\VirtualBox VMs" defaultHardDiskFormat="VDI" VRDEAuthLibrary="VBoxAuth" webServiceAuthLibrary="VBoxAuth" LogHistoryCount="3" proxyMode="0" exclusiveHwVirt="false"/>
        <USBDeviceFilters/>
        </Global>
        </VirtualBox>
  • virtual box 的基本設定都是在 ${homedir()}/.VirtualBox/VirtualBox.xml 中,可以從中修改 defaultMachineFolder 的位置,以及各個 machine register 中修改的位置
    1
    2
    3
    <MachineRegistry>
    <MachineEntry uuid="{7b720d67-dcdf-435e-8a69-b07000f0dc5a}" src="D:\VirtualBox VMs\Linux\Linux.vbox"/>
    </MachineRegistry>

Reference