Giter Club home page Giter Club logo

ubuntu-core-desktop's Introduction

GDM on Ubuntu Core

This directory contains an image of Ubuntu Core 22 with the GDM display manager loaded into the boot file system. It can be launched in a Qemu virtual machine by following these instructions:

  1. Download and decompress the two image files and place them in the same directory.

  2. Add an image as a VM launchable from GNOME Boxes or virt-manager:

    # Delete VM if already registered
    virsh --connect qemu:///session undefine --nvram core-desktop
    virt-install --connect qemu:///session --name core-desktop \
      --memory 2048 --vcpus 2 --boot uefi --os-variant ubuntu24.04 \
      --video virtio,accel3d=no --graphics spice \
      --import --disk path=$(pwd)/pc.img,format=raw
    

    (We use the virt-install because the GNOME Boxes seems to create a legacy BIOS VM when adding the image).

  3. Let the VM boot and and automatically restart once as part of the setup process. Once it settles, you can close the virt-viewer window and manage the VM with GNOME Boxes.

  4. Follow the gnome-initial-setup wizard to create a user, and you'll be dropped into an unconfined desktop session.

At present, the wizard fails to make the created user an administrator, limiting what is possible. For now, I've left the root account open with a blank password as a stop-gap measure.

It is also possible to launch the image outside of GNOME Boxes or virt-manager with a command like the following:

    qemu-system-x86_64 -smp 2 -m 2048 -machine accel=kvm \
      -display gtk,gl=on \
      -net nic,model=virtio -net user,hostfwd=tcp::8022-:22 \
      -drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
      -drive file=pc.img,cache=none,format=raw,id=main,if=none \
      -device virtio-blk-pci,drive=main,bootindex=1 \
      -device ac97 -audiodev pa,id=ac97

Other Repositories

Most of the code used to construct the image is now managed in other repositories. Namely:

Snap Repo Recipe Notes
core24-desktop core-base-desktop:24 via launchpad base snap, forked from core24 to integrate GDM graphical login
pc-desktop pc-amd64-gadget-desktop:24 via launchpad gadget snap, forked from pc, using core24-desktop as a base
ubuntu-desktop-session ubuntu-desktop-session-snap:24 via launchpad provides the confined desktop session
snapd ubuntu-core-desktop-snapd:master via launchpad a branch of snapd with additional changes not yet merged to mainline
Core 22 Repositories
Snap Repo Recipe Notes
core22-desktop core-base-desktop:22 via launchpad base snap, forked from core22 to integrate GDM graphical login
pc-desktop pc-amd64-gadget-desktop:22 via launchpad gadget snap, forked from pc, using core22-desktop as a base
pi-desktop pi-desktop via launchpad Pi gadget snap, forked from pi, using core22-desktop as a base
ubuntu-desktop-session ubuntu-desktop-session-snap:22 via launchpad provides the confined desktop session
snapd ubuntu-core-desktop-snapd via ~snappy-dev a branch of snapd with additional changes not yet merged to mainline

In addition, the base snap uses packages from the desktop-snappers core-desktop PPA. This is mostly to backport features we need that are not in jammy-updates.

Extracting the snaps from the image

The built image is a normal hard disk image, which means that it is possible to get the partition list with:

fdisk -lu pc.img

This will show a list like this one:

Disk pc2.img: 12 GiB, 12884901888 bytes, 25165824 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 6E3A867F-8F44-4880-BA2C-FABA633C36E6

Device     Start     End Sectors  Size Type
pc.img1    2048    4095    2048    1M BIOS boot
pc.img2    4096 7172095 7168000  3.4G EFI System

After running the system the first time, other partitions will be added for the system, the user data...

Now, using kpartx we can create loop devices for each of those partitions:

sudo kpartx -av pc-img

Two loop devices, /dev/mapper/loopXXX/p1 and /dev/mapper/loopXXX/p2, will be available. We want to mount the second one, which is the one that contains the EFI system and the base snaps:

sudo mount /dev/mapper/loopXXX/p2 /mnt

And now we can go to /mnt/snaps, and there are all the base snaps.

ubuntu-core-desktop's People

Contributors

jhenstridge avatar kenvandine avatar robert-ancell avatar saviq avatar sergio-costas avatar zyga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ubuntu-core-desktop's Issues

Include LXD alongside Gnome Boxes and virt-manager as VM 'orchestration' manager.

The ubuntu-core-desktop README file says:

This directory contains an image of Ubuntu Core 22 with the GDM display manager loaded into the boot file system. It can be launched in a Qemu virtual machine by following these instructions:

Download and decompress the two image files and place them in the same directory.   

and the README then says:

  • Add an image as a VM launchable from GNOME Boxes or virt-manager:_

Is Canonical going to add/include LXD's VM capability in this README as well?
Including any specific install/config instructions to start/utilize ubuntu-core-desktop in an LXD VM.

Where’s the download link?

I can’t wait to try out Ubuntu Core Desktop. After reading about it on one of the computer news sites, I think it is an awesome idea. I even installed the openSUSE version of this and tried it out, using KDE and Flatpak instead of GNOME and Snap. I would love to try out your version.

I have found this repo, and its README gives me very helpful instructions on how to run it. However, the README references that there are two images to download. I cannot find a link to download these images anywhere! DuckDuckGo does not give me anything useful, and I understand the regular Core images do not come with a desktop.

Furthermore, are there any plans on building a general-use ARM64 build of this project? I run an M1 Mac, and therefore am unable run many Linux distributions (including regular Ubuntu) because they only provide binaries for Intel. (I understand that the Raspberry Pi images only include support for the Raspberri Pi’s specific bootloader, and will not work under standard UEFI. I am happy to be proved wrong, though.)

Ubuntu Core Desktop Size

Our company is interested in evaluating the Ubuntu Core Desktop, but one major concern we have is image size. Devices we run are constrained to 16GB. Ubuntu Core was designed to have a small image size ("...image size of 260MB..." from https://www.zdnet.com/article/ubuntu-core-doubles-down-on-internet-of-things/). Is this the same case with Ubuntu Core Desktop? I wasn't sure if size was much of a consideration with Ubuntu Core Desktop since GNOME desktop is used. Or maybe this is configurable?

iao isn't bootable

An img file conveerted to iso isn't bootable in a virtual machine!

Its not like you didn't have the consideration to provide an iso instead of wasting people's time on a half baked project.

We'll have to wait til later in the year for the iso release you're either unwilling or too lazy to post here.

Hint and tips for budgie

I have been looking at this project to examine whether an immutable version of the budgie desktop is possible.

I have been looking at adding and removing snaps, generating images etc.

I can see that I will need a slight tweaks and a tuck with the ubuntu-session snap for us.

But I am missing the obvious ... what is the snap/snaps project(s) that is/are actually installing gnome-shell plus GDM? Initially I would need to look at substituting gnome-shell with budgie. Eventually replacing GDM with lightdm or similar.

TIA

UPower clients don't receive signals from the server

UPower clients usually connects to the standard DBus signal org.freedesktop.DBus.Properties.PropertiesChanged to detect changes in the properties of a device, like the battery percentage or the charging/on-battery flag. But, for some reason, in the current images of ubuntu-core-desktop, this signal isn't received by the clients if they are snapped. In a normal Ubuntu desktop, the same snap does receive the notifications. Also, running the binary outside the snap, as root, it does receive the signals.

The current SNAPD code has specific apparmor configuration to allow to pass the PropertiesChanged signals:

imagen

To test this, you can download this snap: https://drive.google.com/file/d/1nsPB2amxZaqy5uy5bLAKg2mpvXqmq_L8/view?usp=share_link

Installing it in the system and running it with "snap run upower-test" will show all the properties for the path "/org/freedesktop/UPower/devices/battery_BAT0". Any change on their properties will also be notified (like when the power cord is connected/disconnected).

Running it in a classic Ubuntu desktop, it will work fine (as long as the "upower-observer" plug is connected, of course).

Running it in an ubuntu-core-desktop laptop will read all the properties, but won't detect the signals.

In the same ubuntu-core-desktop system, going to the root terminal and running it directly ("/snap/upower-test/current/usr/bin/upower") will work fine, showing all the properties and detecting the signals.

save file dialog defaults to wrong download location

I have the simple-scan snap in candidate (44.0, Rev 792) on a core desktop system. When I scan a document and click the download button, the default location it tries to open, as a suggested download location, gives a permissions error. This is because the default location opened is /run/user/1001/doc, which nobody will have access to. This happens on the firefox snap as well, so I suspect this is a shared issue.

Screenshot from 2023-07-27 12-28-04

Screenshot from 2023-07-14 13-55-08

You can still click OK and then go select another location like ~/Downloads and download the document just fine though.

"ipp-usb" Snap needs to get seeded, to support driverless USB printers

Most modern printers are driverless IPP printers, and their driverless IPP does not only work via network connections but also via USB, using the IPP-over-USB standard. To support this in Ubuntu Core Desktop, the "ipp-usb" Snap needs to get seeded. Once done this, driverless printers connected via USB are immediately available. The printer's internal web admin interface can then be accessed via http://localhost:60000/.

Question about mount(2)

One of the things I see Snap packages can do is mount or unmount SMB/CIFS shares. That led me to thinking: how would the user mount a filesystem in Ubuntu Core Desktop? From what I can tell the mount binaries are not in the base image. Even if there were there, there would be no terminal in the final image to use them from.

If I were to provide them in a snap with a GUI, I would run into severe problems with where I can mount a share due to strict confinement, because it would have to be under either $SNAP_USER_COMMON or $SNAP_USER_DATA. This to me is not a very user-friendly location to store what is effectively document data. If I were to use the portals to mount it elsewhere, then I would need to use the portal a second time to unmount it (causing a paper cut that users might complain about). And there seems to be no way to have the system open a folder to the user in their file manager (allowing them to access the location that way), which is an API Windows and macOS both provide.

Furthermore, wouldn’t I still need to be root to successfully call mount(2)? Fixing this through use of sudo requires the terminal, and probably wouldn’t be allowed on the Snap Store in the first place.

How am I supposed to take advantage of the cifs-mount interface given all that I have explained above?

Self-built snap image doesn’t use snap

I have set up a regular Ubuntu VM, and used it to build an image I can boot in my VM software. I built this image using make pc.img in the root directory of this repo, with no modifications. However, the output image is a regular (non-Core) live image, with only one snap installed, which is not what I want. This happens despite the build process spending a good chunk of time downloading and unpacking snaps. What’s going wrong?

How to update this?

Hi,

I have downloaded a image from actions and I am going to use it on my secondary device in order to transition my current workflow into all Snap and Workshops LXC containers. I am wondering if I'll be able to update the installed OS from Settings or Terminal (apt upgrade)? Please let me know.

Best regards,

Image won’t boot

Following on from #61, I have downloaded, unpacked, and ran the image file downloaded from this actions run. I am using QEMU, with a similar command line to yours. I changed a few things to work on my copy of macOS QEMU, and I also converted the image from raw to qcow2 to save disk space. Here it is:

exec qemu-system-x86_64 \
	-smp 2 \
	-m 2048 \
	-net nic,model=virtio -net user,hostfwd=tcp::8022-:22 \
	-drive file=/opt/homebrew/share/qemu/edk2-x86_64-code.fd,if=pflash,format=raw,unit=0,readonly=on \
	-drive file=ubuntu-core-desktop.qcow2,cache=none,format=qcow2,id=main,if=none \
	-device virtio-blk-pci,drive=main,bootindex=1

However, when I do this, EFI gives me the error: error: no such device: ubuntu-boot, then goes to a black screen with an underscore and locks up. I have also tried using this image in the UTM app, with a similar command line. It does the same thing there. All things being equal, I’d rather use UTM, but I wanted to try raw QEMU since that’s what the README said. Are you able to give me any guidance here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.