Creating a virtual machine (ubuntu) with virtual box

Yesterday, I created a virtual machine for ubuntu system using VirtualBox.

  1. Download the iso file of the operating system:
    ubuntu.iso
  2. Open VirtualBox, then choose the corresponding operating system:
    VirtualBox1
  3. Mount the iso file on VirtualBox:
    VirtualBox
  4. Format the disk space.
  5. Complete the regular settings.
  6. Set network adapters:
    _ there can be multiple adapters
    _ For my virtual machine, one adapter is used for NAT, the other one is used to connect to the host through ssh
    image
  7. remotely connect to the virtual machine through ssh:
    On host system, search for folder .ssh . There should be a public key id_rsa.pub .
    Then open it either using
    1
    cat id_rsa.pub
    or
    1
    vim id_rsa.pub
    Switch to the virtual machine, again, find .ssh folder and open it with
    1
    vim authorized_keys
    and paste the public key to the file, then save and close the file with
    1
    :wq [ENTER]
  8. Use
    1
    ip a
    to chech the ip address of the virtual machine, and connect to the virtual machine through ssh remotely.

Creating a virtual machine (ubuntu) with virtual box

http://gong208.github.io/2022/07/11/2022-07-11-VirtualMachine/

Author

Jiangshan Gong

Posted on

2022-07-11

Updated on

2023-08-11

Licensed under

Comments