Virtualbox: Forskjell mellom sideversjoner

Fra pc-aid wiki
Malinux (diskusjon | bidrag)
Ingen redigeringsforklaring
Malinux (diskusjon | bidrag)
Linje 105: Linje 105:
= Troubleshooting (FIXME formatting) =
= Troubleshooting (FIXME formatting) =
After cloning a virtual disk, the memory buffer can become so full that you get the following error message: Out of memory condition when allocating memory with low physical backing. (VERR_NO_LOW_MEMORY).
After cloning a virtual disk, the memory buffer can become so full that you get the following error message: Out of memory condition when allocating memory with low physical backing. (VERR_NO_LOW_MEMORY).
 
{| class="wikitable"
|Result Code:
|NS_ERROR_FAILURE (0X80004005)
|-
|Component:
|ConsoleWrap
|-
|Interface:
|IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}  
|}
'''malinux@debian''':'''~'''$ free -h            total used free shared buff/cache available. Go: 31Gi 9.3Gi 880Mi 415Mi 21Gi 21Gi Växl.:          15Gi       256Ki        15Gi '''To solve this:''' '''Either restart the machine or run this command on the host machine:''' '''sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"''' source: https://bbs.archlinux.org/viewtopic.php?id=298056 https://unix.stackexchange.com/questions/109496/echo-3-proc-sys-vm-drop-caches-permission-denied-as-root '''malinux@debian''':'''~'''$ free -h            total used free shared buff/cache available. Memory: 31Gi 9.4Gi 20Gi 421Mi 2.3Gi 21Gi Växl.:          15Gi       256Ki        15Gi = Disk use before installation of OpenMRS sdk, java and mariadb
'''malinux@debian''':'''~'''$ free -h            total used free shared buff/cache available. Go: 31Gi 9.3Gi 880Mi 415Mi 21Gi 21Gi Växl.:          15Gi       256Ki        15Gi '''To solve this:''' '''Either restart the machine or run this command on the host machine:''' '''sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"''' source: https://bbs.archlinux.org/viewtopic.php?id=298056 https://unix.stackexchange.com/questions/109496/echo-3-proc-sys-vm-drop-caches-permission-denied-as-root '''malinux@debian''':'''~'''$ free -h            total used free shared buff/cache available. Memory: 31Gi 9.4Gi 20Gi 421Mi 2.3Gi 21Gi Växl.:          15Gi       256Ki        15Gi = Disk use before installation of OpenMRS sdk, java and mariadb


= '''openmrs@openmrs''':'''~'''$ df -h File System Size Used Appl. Use% Mounted on udev 2.9G 0 2.9G 0% /dev tmpfs               593M  1,1M   592M    1% /run /dev/sda1 19G 6.9G 11G 40% / tmpfs 2.9G 0 2.9G 0% /dev/shm tmpfs               5,0M  8,0K   5,0M    1% /run/lock tmpfs               593M   72K   593M    1% /run/user/1000 '''openmrs@openmrs''':'''~'''$ = Disk useage after installation of OpenMRS sdk, java and mariadb = = Virtualbox installation in Debian 12 = # Install virtualbox 7.1 i Debian 12 bookworm # Put the repo, signature and install in one command, by copying and pasting into konsoe: sudo touch /etc/apt/sources.list.d/virtualbox.list && echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian bookworm contrib' | sudo tee /etc/apt/sources.list.d/virtualbox.list && wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor && sudo apt update && sudo apt install virtualbox-7.1 # virtualbox 7.1 is now installed in Debian 12
= '''openmrs@openmrs''':'''~'''$ df -h File System Size Used Appl. Use% Mounted on udev 2.9G 0 2.9G 0% /dev tmpfs               593M  1,1M   592M    1% /run /dev/sda1 19G 6.9G 11G 40% / tmpfs 2.9G 0 2.9G 0% /dev/shm tmpfs               5,0M  8,0K   5,0M    1% /run/lock tmpfs               593M   72K   593M    1% /run/user/1000 '''openmrs@openmrs''':'''~'''$ = Disk useage after installation of OpenMRS sdk, java and mariadb = = Virtualbox installation in Debian 12 = # Install virtualbox 7.1 i Debian 12 bookworm # Put the repo, signature and install in one command, by copying and pasting into konsoe: sudo touch /etc/apt/sources.list.d/virtualbox.list && echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian bookworm contrib' | sudo tee /etc/apt/sources.list.d/virtualbox.list && wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor && sudo apt update && sudo apt install virtualbox-7.1 # virtualbox 7.1 is now installed in Debian 12

Sideversjonen fra 17. mar. 2025 kl. 20:46

1 Installation of VirtualBox in Debian 12

1.2 Install virtualbox 7.1 i Debian 12 bookworm

Put the repo, signature and install in one command, by copying and pasting into konsole:

sudo touch /etc/apt/sources.list.d/virtualbox.list && echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian bookworm contrib' | sudo tee /etc/apt/sources.list.d/virtualbox.list && wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor && sudo apt update && sudo apt install virtualbox-7.1

virtualbox 7.1 is now installed in Debian 12

2 Install VBoxGuestAdditions in virtualbox

VBoxGuestAdditions provides the following features:

  • Host/Guest clock synchronization
  • Seamless window support
  • Shared folders
  • Shared clipboard
  • Mouse pointer improvements
  • Improved video support

2.1 On the Host Machine: Download VBoxGuestAdditions.iso

Dowload for the version you are running of Virtualbox. In the example we use VirtualBox7.1 as we installed in section 1. Therefore we download VBoxGuestAdditions_7.1.0.iso with wget to a folder on the host machine, for example:

wget https://download.virtualbox.org/virtualbox/7.1.0/VBoxGuestAdditions_7.1.0.iso

2.2 Start up the relevant virtual machine (Guest) running Debian 12

2.2.1 Mount the iso inside the virtual Debian install

Press Devices -> Optical Drives -> Then press Chose a disk file and scroll to where you downloaded the iso file to, press the iso file

You will get a pop-up message in the bottom right corner:

Press «Mount and open»

2.2.2 Open Terminal

Right-click in the window that pops up and press on "Open terminal here"

2.2.3 Install kernel header and build tools

Install kernel header for running kernel and build tools and press enter -> enter the password and press enter again:

sudo apt install linux-headers-amd64 build-essential -y
2.2.4 Install the VBoxLinuxAdditions

Run the following command to install the virtualbox add-on and press enter:

sudo sh VBoxLinuxAdditions.run

Enter the password of the user and press enter again if prompted.

2.2.5 Log out and in or restart the virtual machine to complete installation

Log out and log in again or:

restart the virtual machine by pressing;

Start button at bottom left -> Exit ->  

Press OK or wait 30 seconds

2.2.6 Enable biderectional clipboard

Once the virtual machine has restarted, in virtualbox press: Devices -> Shared Clipboard -> Bidrectional

Note: With Bidirectional, you can copy to and from the virtual machine 🙂

3 Get virtual machine accessable from the internet

3.1 Set up network bridge

In virtualbox, tap the virtual machine in the list on the that you want to reach from the internet

Press the yellow gear symbol Settings (top right)

In the left menu, select Network. In Adapter 1 -> go to Attached to: and select "Bridged Adapter" In Name: it should say the same network interface as the host computer.

Then press OK

Now start the virtual machine by pressing -> start

3.2 Find the local IP address of the virtual machine

Find the ip address of the virtual machine so we can expose it to the internet

type in Konsole:

ip-a

Extract of what you get by running the command above:

enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:53:e3:d1 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.135/24 brd 192.168.0.255 scope global dynamic noprefixroute enp0s3

Highlighted is the local ip address of the virtual machine.

Note: Your IP address may be different

3.3 Open the port in the router

In your router, visit the place where you open up ports. Where you do this on your router varies from manufacturer to manufacturer. In this example the web service we want to access is on port 8080

On an ASUS GT-AC2900 router, it is done this way:

Select WAN in the left menu -> Virtual Server / Port Forwarding -> scroll down and select "Add profile". Fill in the following:

Protocol: TCP

External Port: 8080

Internal IP Address: 192.168.0.135

NOTE. The IP address of the virtual machine may be different for you.

Press OK

Go to https://whatismyip.com to find your external IP address

Open a browser on the host, or on another computer and go to: http://<your external ip>:8080/path/to/service

Troubleshooting (FIXME formatting)

After cloning a virtual disk, the memory buffer can become so full that you get the following error message: Out of memory condition when allocating memory with low physical backing. (VERR_NO_LOW_MEMORY).

Result Code: NS_ERROR_FAILURE (0X80004005)
Component: ConsoleWrap
Interface: IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}  

malinux@debian:~$ free -h            total used free shared buff/cache available. Go: 31Gi 9.3Gi 880Mi 415Mi 21Gi 21Gi Växl.:          15Gi       256Ki        15Gi To solve this: Either restart the machine or run this command on the host machine: sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches" source: https://bbs.archlinux.org/viewtopic.php?id=298056 https://unix.stackexchange.com/questions/109496/echo-3-proc-sys-vm-drop-caches-permission-denied-as-root malinux@debian:~$ free -h            total used free shared buff/cache available. Memory: 31Gi 9.4Gi 20Gi 421Mi 2.3Gi 21Gi Växl.:          15Gi       256Ki        15Gi = Disk use before installation of OpenMRS sdk, java and mariadb

= openmrs@openmrs:~$ df -h File System Size Used Appl. Use% Mounted on udev 2.9G 0 2.9G 0% /dev tmpfs               593M  1,1M   592M    1% /run /dev/sda1 19G 6.9G 11G 40% / tmpfs 2.9G 0 2.9G 0% /dev/shm tmpfs               5,0M  8,0K   5,0M    1% /run/lock tmpfs               593M   72K   593M    1% /run/user/1000 openmrs@openmrs:~$ = Disk useage after installation of OpenMRS sdk, java and mariadb = = Virtualbox installation in Debian 12 = # Install virtualbox 7.1 i Debian 12 bookworm # Put the repo, signature and install in one command, by copying and pasting into konsoe: sudo touch /etc/apt/sources.list.d/virtualbox.list && echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian bookworm contrib' | sudo tee /etc/apt/sources.list.d/virtualbox.list && wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor && sudo apt update && sudo apt install virtualbox-7.1 # virtualbox 7.1 is now installed in Debian 12