Skip to content

Instantly share code, notes, and snippets.

@vheidari
Last active February 7, 2023 01:04
Show Gist options
  • Save vheidari/d94308d6b9b4fc3f126ae523ae9ae3ff to your computer and use it in GitHub Desktop.
Save vheidari/d94308d6b9b4fc3f126ae523ae9ae3ff to your computer and use it in GitHub Desktop.
How to install SerenityOS On [ LINUX Mint - VERSION="20.3 (Una)" - Kernel : 5.15.0-33-generic ]

How to install SerenityOS On [ LINUX Mint - VERSION="20.3 (Una)" - Kernel : 5.15.0-33-generic ]

There are some instructions that can help you install and run "SerenityOS" on "Linux Mint"

First - Cloning Project :

-- git clone https://github.com/SerenityOS/serenity.git

Second, install a list of dependencies for this project :

Install Debian / Ubuntu dependencies

-- sudo apt install build-essential cmake curl libmpfr-dev libmpc-dev libgmp-dev e2fsprogs ninja-build qemu-system-gui qemu-system-x86 qemu-utils ccache rsync unzip texinfo

GCC 10 && GCC 11

-- sudo apt install gcc-10 g++-10 gcc-11 g++-11

Install Qemu 6.2 dependencies

-- sudo apt install libgtk-3-dev libpixman-1-dev libsdl2-dev libspice-server-dev
-- sudo apt-get install git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build

Recommended additional packages ( Note : Please install these dependencies step by step )

-- sudo apt-get install git-email
-- sudo apt-get install libaio-dev libbluetooth-dev libcapstone-dev libbrlapi-dev libbz2-dev
-- sudo apt-get install libcap-ng-dev libcurl4-gnutls-dev libgtk-3-dev
-- sudo apt-get install libibverbs-dev libjpeg8-dev libncurses5-dev libnuma-dev
-- sudo apt-get install librbd-dev librdmacm-dev
-- sudo apt-get install libsasl2-dev libsdl2-dev libseccomp-dev libsnappy-dev libssh-dev
-- sudo apt-get install libvde-dev libvdeplug-dev libvte-2.91-dev libxen-dev liblzo2-dev
-- sudo apt-get install valgrind xfslibs-dev

Newer versions of Debian/Ubuntu may also require these additional packages :

-- sudo apt-get install libnfs-dev libiscsi-dev

Third, install Qemu version 6.2 or later

Note: Installing QEMU from the default repository on Linux Mint will install an old version of QEMU. To install the latest version, I recommend getting the QEMU zip file from https://download.qemu.org/qemu-7.0.0.tar.xz, extracting it, and building it from source :

-- wget https://download.qemu.org/qemu-7.0.0.tar.xz
-- tar -xf qemu-7.0.0.tar.xz
-- cd qemu-7.0.0
-- ./configure
-- make 
-- make install

With Git :

-- git clone https://gitlab.com/qemu-project/qemu.git
-- cd qemu
-- git submodule init
-- git submodule update --recursive
-- ./configure
-- make
-- make install

** In the SerenityOS folder, run the BuildQemu.sh Bash script file located in serenity/Toolchain/BuildQemu.sh **

This builds 'Qemu' from source and stores it in the serenity/Build/qemu folder.

Note : when you create 'Qemu' with this method it's not install 'Qemu' as global on your machine

-- cd Toolchain
-- ./BuildQemu.sh

Fourth - Build the ToolChain by running following command :

-- Meta/serenity.sh rebuild-toolchain

Fifth - Resolve 'qemu-system-x86_64: Display spice is incompatible with the GL context' Error before build

Note: Open This File serenity/Meta/run.sh and change following line :

-- SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-sdl,gl=on}"

to :

-- SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-sdl,gl=off}"

And Save it, then run following command

-- Meta/serenity.sh run

Links :

SerenityOs github :
    - https://github.com/SerenityOS/serenity
Qemu Host/Linux Dependency :
    - https://wiki.qemu.org/Hosts/Linux
BuildInstructions.md :
    - https://github.com/SerenityOS/serenity/blob/c62c10caf03a90d665bf934b376c3a68bb69341e/Documentation/BuildInstructions.md
Troubleshooting.md :
    - https://github.com/SerenityOS/serenity/blob/c62c10caf03a90d665bf934b376c3a68bb69341e/Documentation/Troubleshooting.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment