Avatar of chalie001
 asked on

lxc/lxd container

hi how can i install oracle datbase in lxd container i did this

lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]: storage
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]: dir
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like the LXD server to be available over the network? (yes/no) [default=no]: yes
Address to bind LXD to (not including port) [default=all]:
Port to bind LXD to [default=8443]:
Trust password for new clients:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
docker@docker-VirtualBox:~$ ps -ef | grep lxd
root        5691       1  0 04:53 ?        00:00:00 /bin/sh /snap/lxd/21835/commands/daemon.start
root        5843       1  0 04:53 ?        00:00:00 lxcfs /var/snap/lxd/common/var/lib/lxcfs -p /var/snap/lxd/common/lxcfs.pid
root        5854    5691  0 04:53 ?        00:00:01 lxd --logfile /var/snap/lxd/common/lxd/logs/lxd.log --group lxd
lxd         7567    5854  0 05:09 ?        00:00:00 dnsmasq --keep-in-foreground --strict-order --bind-interfaces --except-interface=lo --pid-file= --no-ping --interface=lxdbr0 --dhcp-rapid-commit --quiet-dhcp --quiet-dhcp6 --quiet-ra --listen-address= --dhcp-no-override --dhcp-authoritative --dhcp-leasefile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases --dhcp-hostsfile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.hosts --dhcp-range,,1h -s lxd --interface-name _gateway.lxd,lxdbr0 -S /lxd/ --conf-file=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.raw -u lxd -g lxd
docker      7673    3582  0 05:10 pts/0    00:00:00 grep --color=auto lxd

LinuxDockerLXCLinux DistributionsLinux Networking

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon
David Favor

I suggest you destroy your entire LXD installation + start again.

Here's how I do this... because every new machine requires a 100% common setup with me...

lxd init --auto --storage-backend=dir
lxc network attach-profile lxdbr0 default $base-interface

Open in new window

In other words, skip all other init options, as they can cause near impossible to debug problems.

If all's well, you should be able to run this command, where command runs showing no containers running...

lxc list

Open in new window

Then to install Oracle...

lxc launch ubuntu:focal c1
lxc exec c1 bash

# Now setup your container IP - /etc/netplan/60-public-init.yaml - or some file to run after 10-lxc.yaml, so any higher number will work.
# cat /etc/netplan/60-public-init.yaml 
    version: 2

# Then install Oracle, as same as you'd install Oracle on any machine.

# Then restart your container, to bring up your IP + ensure Oracle restarts correctly.

Open in new window

At this point only item remaining is to make sure you're running a route command periodically to regenerate all your routes, as every SNAP update (can be many a day sometimes), will lose all routes.

Open a new question about Route Revivification, if you haven't worked out this detail yet.

why should i install oracle in ubuntu i what to use oracle linux

lxc list
| NAME |  STATE  |         IPV4          | IPV6 |   TYPE    | SNAPSHOTS |
| acor | RUNNING | (eth0) |      | CONTAINER | 0         |

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
David Favor

1) Excellent!

Looks like you have a container running now!

2) You asked, "why should i install oracle in ubuntu i what to use oracle linux".

Only you can answer this, as you'll chose to create an Ubuntu container or Oracle Linux container.

My personally, I always use Ubuntu as Ubuntu is the development reference Distro for LXD, so Ubuntu always has most testing + most correct problem solutions in forums.

3) If I had to run Oracle, I'd create an Ubuntu container + install Oracle... which looks like... installing one of the linux-oracle packages.

lxc network attach-profile lxdbr0 default $base-interface
Error: unknown shorthand flag: 'i' in -interface


s$ sudo snap install certbot --classic
certbot 1.22.0 from Certbot Project (certbot-eff✓) installed
react@react-VirtualBox:~/Documents/images$ sudo snap install nmap
nmap 7.92 from Maximiliano Bertacchini (maxiberta) installed
react@react-VirtualBox:~/Documents/images$ sudo snap connect nmap:network-control
react@react-VirtualBox:~/Documents/images$ lxd init --auto --storage-backend=dir
react@react-VirtualBox:~/Documents/images$ lxc network attach-profile lxdbr0 default $base-interface
Error: unknown shorthand flag: 'i' in -interface
react@react-VirtualBox:~/Documents/images$ lxc list
To start your first container, try: lxc launch ubuntu:20.04
Or for a virtual machine: lxc launch ubuntu:20.04 --vm


Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
David Favor

You must replace "$base-interface" with your actual interface, which only you know.

Might be eth0 or en0 or any number of interface names, which are all dependent on your specific hosting company.
David Favor

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question