- Downloading a CentOS VDI and creating a VM template
- Configuring a Host-only network adapter to assign a static IP
- Installing Docker and running the GitLab CE container with persistent storage

- Click New.
- Choose the OS type (e.g., Other Linux (64-bit)).
- Set memory to 2 GB (2048 MB).
- For the hard disk, choose “Use existing” and browse to the extracted
.vdifile.


- Give the VM 2 CPUs (or at least 1–2 depending on host).
- Set Adapter 1 to a Bridged Adapter (for Internet access from the VM).
- Set Adapter 2 to the Host-only adapter you created (for local static IP access from your host).

osboxes.org for user and password).

GitLab), choose a linked clone to save space, and check “Reset MAC address” to ensure a new MAC for the cloned VM.
Assign a static IP inside the CentOS guest
Start the cloned VM and log in. Confirm the host-only interface is present (often enp0s8) with ifconfig or ip addr. If there is no IPv4 address, configure a static one.
On CentOS 7, network interface scripts live in /etc/sysconfig/network-scripts/. A straightforward workflow is to copy an existing template and edit it:
/etc/sysconfig/network-scripts/ifcfg-enp0s8 to include your static configuration:
IPADDR/GATEWAY to match the host-only adapter you created in VirtualBox.
Restart network services and verify:
enp0s8 (for example 192.168.56.150).
Assigning a host-only static IP keeps your GitLab server address predictable. If you later change the VM’s IP you must update GitLab’s
external_url and any host file or DNS entries used to reach the instance.- GitLab docs: https://docs.gitlab.com/ee/install/
curl, policycoreutils, and openssh-server. Enable and start sshd and open HTTP/HTTPS in the firewall. Example installation and service commands:

gitlab/gitlab-ce). Prepare persistent directories on the host and set external_url through GITLAB_OMNIBUS_CONFIG. If SELinux is enabled on the host, append :Z to the volume mounts to set proper labels.
Create persistent directories:
Important tips and firewall rules
- Using an IP for
external_urlis fine for a local lab, but some features expect a resolvable FQDN. Add an entry to your host’s/etc/hostsif you want to reach GitLab by name without DNS. - Ensure the host firewall allows the published ports:
If SELinux is enabled and you omit
:Z on volume mounts, the container may be unable to write to the mounted directories. Use :Z or set proper SELinux labels and permissions on /srv/gitlab/* before starting the container.http://192.168.56.150). On first access you will be prompted to set the root password. After resetting the password, sign in with root and the password you chose.


- GitLab installation docs: https://docs.gitlab.com/ee/install/
- GitLab Docker Hub: https://hub.docker.com/r/gitlab/gitlab-ce
- Oracle VirtualBox: https://www.virtualbox.org/
- osboxes CentOS images: https://www.osboxes.org/