Absolutely! Here's a step-by-step guide to join your Ubuntu 22.04 LTS
VM to an Active Directory (AD) domain using the realmd method,
which is the most straightforward and supported way to domain-join
modern Ubuntu systems.
Win server 2025
✅ Assumptions
Ubuntu hostname: ubuntu-client (you can change it).
Ubuntu IP: 192.168.100.20
AD Domain: lorenzo-meli.be
Domain Controller (DC) IP: 192.168.100.10
You have a domain admin account (e.g., Administrator or any user
with join privileges).
DNS is correctly set to point to the AD DC.
🔧 Step 1: Set the hostname (Optional but recommended)
bash
KopiërenBewerken
sudo hostnamectl set-hostname ubuntu-client
🛜 Step 2: Set DNS to point to the AD server
Edit your Netplan config or resolv.conf temporarily:
bash
KopiërenBewerken
sudo nano /etc/systemd/resolved.conf
Uncomment and edit:
ini
KopiërenBewerken
DNS=192.168.100.10
Domains=lorenzo-meli.be
, Then restart resolved:
bash
KopiërenBewerken
sudo systemctl restart systemd-resolved
Verify DNS resolution:
bash
KopiërenBewerken
dig lorenzo-meli.be
📦 Step 3: Install necessary packages
bash
KopiërenBewerken
sudo apt update
sudo apt install -y realmd sssd sssd-tools libnss-sss libpam-sss adcli
samba-common-bin oddjob oddjob-mkhomedir packagekit
🔍 Step 4: Discover the domain
bash
KopiërenBewerken
realm discover lorenzo-meli.be
Expected output (or similar):
Yaml
KopiërenBewerken
lorenzo-meli.be
type: kerberos
realm-name: LORENZO-MELI.BE
domain-name: lorenzo-meli.be
configured: no
VM to an Active Directory (AD) domain using the realmd method,
which is the most straightforward and supported way to domain-join
modern Ubuntu systems.
Win server 2025
✅ Assumptions
Ubuntu hostname: ubuntu-client (you can change it).
Ubuntu IP: 192.168.100.20
AD Domain: lorenzo-meli.be
Domain Controller (DC) IP: 192.168.100.10
You have a domain admin account (e.g., Administrator or any user
with join privileges).
DNS is correctly set to point to the AD DC.
🔧 Step 1: Set the hostname (Optional but recommended)
bash
KopiërenBewerken
sudo hostnamectl set-hostname ubuntu-client
🛜 Step 2: Set DNS to point to the AD server
Edit your Netplan config or resolv.conf temporarily:
bash
KopiërenBewerken
sudo nano /etc/systemd/resolved.conf
Uncomment and edit:
ini
KopiërenBewerken
DNS=192.168.100.10
Domains=lorenzo-meli.be
, Then restart resolved:
bash
KopiërenBewerken
sudo systemctl restart systemd-resolved
Verify DNS resolution:
bash
KopiërenBewerken
dig lorenzo-meli.be
📦 Step 3: Install necessary packages
bash
KopiërenBewerken
sudo apt update
sudo apt install -y realmd sssd sssd-tools libnss-sss libpam-sss adcli
samba-common-bin oddjob oddjob-mkhomedir packagekit
🔍 Step 4: Discover the domain
bash
KopiërenBewerken
realm discover lorenzo-meli.be
Expected output (or similar):
Yaml
KopiërenBewerken
lorenzo-meli.be
type: kerberos
realm-name: LORENZO-MELI.BE
domain-name: lorenzo-meli.be
configured: no