qvm-clone fedora-20-x64 fedora-21
qvm-run -a fedora-21 gnome-terminal
sudo yum erase nautilus-actions
sudo yum clean all
# For release 2 of Qubes
sudo yum --enablerepo=qubes-vm-r2-current-testing --releasever=21 distro-sync
# For release 3 of Qubes
sudo yum --enablerepo=qubes-vm-r3.0-current-testing --releasever=21 distro-sync
sudo cp /usr/lib/qubes/init/ip* /etc/syconfig/
# poweroff via qubes-manager; may need to be killed
truncate -s 5GB /var/tmp/template-upgrade-cache.img
qvm-block -A fedora-21 dom0:/var/tmp/template-upgrade-cache.img
sudo mkfs.ext4 /dev/xvdi
sudo mount /dev/xvdi /mnt/removable
sudo cp -p /etc/sysconfig/ip* /home/user
sudo yum erase nautilus-actions
sudo yum clean all
# For release 2 of Qubes
sudo yum --enablerepo=qubes-vm-r2-current-testing --releasever=21 --setopt=cachedir=/mnt/removable distro-sync
# For release 3 of Qubes
sudo yum --enablerepo=qubes-vm-r3.0-current-testing --releasever=21 --setopt=cachedir=/mnt/removable distro-sync
sudo cp /usr/lib/qubes/init/ip* /etc/syconfig/
# poweroff via qubes-manager; may need to be killed
sudo mkdir /mnt/removable/modules
sudo cp -rp /usr/lib/modules /mnt/removable/modules/
sudo mount --bind /mnt/removable/modules /usr/lib/modules
qvm-run -a fedora-21 gnome-terminal
Once
started, within gnome-terminal, we need to make sure everything is
up-to-date. Most likely some more packages will be installed to satisfy
the upgrade dependencies
sudo yum upgrade
qvm-trim-template fedora-21
dd if=/dev/zero of=/zero
(wait for "No space left on device" error)
rm -f /zero
# Note: wiki states to use of=/var/tmp/zero. I wasn't sure if it was mapped to memory so changed it to /zero
cp --sparse=always root.img root.img.new
mv root.img.new root.img
I created some instructions on how to update a Fedora 20 template to Fedora 21 based on the existing wiki instructions. I hope someone finds it useful :)
One thing to note is that updates through qubes-manager GUI do not currently work. They will have to be done manually within a gnome-terminal or xterm session.
Upgrading Fedora 20 to Fedora 21
Commands to run in dom0 console (you can do the same from Qubes Manager):qvm-clone fedora-20-x64 fedora-21
qvm-run -a fedora-21 gnome-terminal
Update instructions if fedora-21 template has at least 3GB free space.
Commands to run in new fedora-21 template:sudo yum erase nautilus-actions
sudo yum clean all
# For release 2 of Qubes
sudo yum --enablerepo=qubes-vm-r2-current-testing --releasever=21 distro-sync
# For release 3 of Qubes
sudo yum --enablerepo=qubes-vm-r3.0-current-testing --releasever=21 distro-sync
sudo cp /usr/lib/qubes/init/ip* /etc/syconfig/
# poweroffvia qubes-manager; may need to be killed
Update instructions if fedora-21 template DOES NOT have at least 3GB free space
If you have installed a lot of software in your template, it may happen that you don’t have enough disk space for upgrade. Yum will tell you this just after confirming the operation (before it change anything to your system). In that case you need to provide some “external” place for yum cache (uses about 3GB during upgrade). After being notified by yum that you need more disk space to perform the upgrade, leave the fedora-21 template running and proceed to create and attach additional storage.
Prepare the file in dom0 (Be sure the new fedora-21 TemplateVM is still running gnome-terminal):truncate -s 5GB /var/tmp/template-upgrade-cache.img
qvm-block -A fedora-21 dom0:/var/tmp/template-upgrade-cache.img
Then use it in template:sudo mkfs.ext4 /dev/xvdi
sudo mount /dev/xvdi /mnt/removable
sudo cp -p /etc/sysconfig/ip* /home/user
sudo yum erase nautilus-actions
sudo yum clean all
# For release 2 of Qubes
sudo yum --enablerepo=qubes-vm-r2-current-testing --releasever=21 --setopt=cachedir=/mnt/removable distro-sync
# For release 3 of Qubes
sudo yum --enablerepo=qubes-vm-r3.0-current-testing --releasever=21 --setopt=cachedir=/mnt/removable distro-sync
sudo cp /usr/lib/qubes/init/ip* /etc/syconfig/
# poweroff via qubes-manager; may need to be killed
After upgrade is finished, you can remove /var/tmp/template-upgrade-cache.img file.
If yum complains that there is not enough free space in /usr/lib/modules, try this:sudo mkdir /mnt/removable/modules
sudo cp -rp /usr/lib/modules /mnt/removable/modules/
sudo mount --bind /mnt/removable/modules /usr/lib/modules
Starting the newly created fedora-21 TemplateVM for the first time
Either start the new template via qubes-manager or in dom0:qvm-run -a fedora-21 gnome-terminal
Once started, within gnome-terminal, we need to make sure everything is up-to-date. Most likely some more packages will be installed to satisfy the upgrade dependenciessudo yum upgrade
Compacting templates root.img
fstrim, nor “discard” mount option do not work on template root fs, so when some file is removed in the template, space isn’t freed in dom0. This means that template will use about twice a space that is really need after upgrade.
In dom0 console (broken in Qubes R3-RC1):qvm-trim-template fedora-21
You can compact root.img in the “old way” instead of using qvm-trim-template. You’ll need about 15GB (template’s max size + really used space there) in dom0 for this operation: Start the template, fill all the free space with zeros, for example with:dd if=/dev/zero of=/zero
(wait for "No space left on device" error)
rm -f /zero
# Note: wiki states to use of=/var/tmp/zero. I wasn't sure if it was mapped to memory so changed it to /zero
Then shutdown template and all VMs based on it. Go into template directory in dom0 (/var/lib/qubes/vm-templates/fedora-21 or so) and issue:cp --sparse=always root.img root.img.new
mv root.img.new root.img
--
You received this message because you are subscribed to the Google Groups "qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qubes-users...@googlegroups.com.
To post to this group, send email to qubes...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/CAMWEgd%3DPB5T9SOUymJxjTU4rO-R6QHHY%3D0scwdvt8VyS8WVXUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
After upgrade is finished, you can remove /var/tmp/template-upgrade-cache.img file.
If yum complains that there is not enough free space in /usr/lib/modules, try this:sudo mkdir /mnt/removable/modules
sudo cp -rp /usr/lib/modules /mnt/removable/modules/
sudo mount --bind /mnt/removable/modules /usr/lib/modules
Starting the newly created fedora-21 TemplateVM for the first time
Either start the new template via qubes-manager or in dom0:qvm-run -a fedora-21 gnome-terminal
Once started, within gnome-terminal, we need to make sure everything is up-to-date. Most likely some more packages will be installed to satisfy the upgrade dependenciessudo yum upgrade
Compacting templates root.img
fstrim, nor “discard” mount option do not work on template root fs, so when some file is removed in the template, space isn’t freed in dom0. This means that template will use about twice a space that is really need after upgrade.
In dom0 console (broken in Qubes R3-RC1):qvm-trim-template fedora-21If the above simple line achieves the same result as the more complex procedure below, up to the end of your instructions, why should one bother considering the complex procedure? Only in the case the single line gives errors?
To increase the size of the new Fedora 21 template, I think you can use the command qvm-grow-root (I have never used it, so this is a guess):qvm-grow-root fedora-21 15GB
After upgrade is finished, you can remove /var/tmp/template-upgrade-cache.img file.
If yum complains that there is not enough free space in /usr/lib/modules, try this:sudo mkdir /mnt/removable/modules
sudo cp -rp /usr/lib/modules /mnt/removable/modules/
sudo mount --bind /mnt/removable/modules /usr/lib/modules
Starting the newly created fedora-21 TemplateVM for the first time
Either start the new template via qubes-manager or in dom0:qvm-run -a fedora-21 gnome-terminal
Once started, within gnome-terminal, we need to make sure everything is up-to-date. Most likely some more packages will be installed to satisfy the upgrade dependenciessudo yum upgrade
Compacting templates root.img
fstrim, nor “discard” mount option do not work on template root fs, so when some file is removed in the template, space isn’t freed in dom0. This means that template will use about twice a space that is really need after upgrade.
In dom0 console (broken in Qubes R3-RC1):qvm-trim-template fedora-21If the above simple line achieves the same result as the more complex procedure below, up to the end of your instructions, why should one bother considering the complex procedure? Only in the case the single line gives errors?If you look closely I state (highlighted in yellow above) the simple procedure is broken in Release 3. So in Qubes release 3 you will need to follow the procedure below, otherwise the one-line is all you need.
You can compact root.img in the “old way” instead of using qvm-trim-template. You’ll need about 15GB (template’s max size + really used space there) in dom0 for this operation: Start the template, fill all the free space with zeros, for example with:dd if=/dev/zero of=/zero
(wait for "No space left on device" error)
rm -f /zero
# Note: wiki states to use of=/var/tmp/zero. I wasn't sure if it was mapped to memory so changed it to /zero
Then shutdown template and all VMs based on it. Go into template directory in dom0 (/var/lib/qubes/vm-templates/fedora-21 or so) and issue:cp --sparse=always root.img root.img.new
mv root.img.new root.imgIs the last paragraph above part of the more complex procedure, or should it be performed also using qvm-trim-template?The last paragraph is part of the more complet procedure. If the one-liner works out for you, then you are done!
To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/cfc153a6-b40a-486e-86fd-335b930315fc%40googlegroups.com.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 06/16/2015 01:11 AM, Franz wrote:
> Qubes R2. After a little testing it seems everything is working,
> except netvm and firewallvm. If they are based on fedora-21
> template all VMs loose network connection, even if I can ping
> google.com <http://google.com> from netvm terminal. So had to base
> both of them again on fedora -20 template.
>
> Any idea to solve this?
Try this in the template:
sudo cp /usr/lib/qubes/init/ip* /etc/syconfig/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
nrgaway wrote:
[...]
> Prepare the file in dom0 (Be sure the new fedora-21 TemplateVM is
> still running gnome-terminal): truncate -s 5GB
> /var/tmp/template-upgrade-cache.img qvm-block -A fedora-21
> dom0:/var/tmp/template-upgrade-cache.img
>
> Then use it in template: sudo mkfs.ext4 /dev/xvdi sudo mount
> /dev/xvdi /mnt/removable
>
> sudo cp -p /etc/sysconfig/ip* /home/user
What is the purpose of this line? ^^^
(I don't see any later step where we copy files back from /home/user.)
sudo mount --bind /mnt/removable/modules /usr/lib/modules- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBAgAGBQJVkROGAAoJENuP0xzK19csVi0H/0H8CYRIuq8xEu2D5lIUikOy
D0QXGjiGV1RCgJ/24L/yxmXJuMec7fYMAfBnmGmaR8F787a92w/1xPXQh6WQmjav
FRSEZymDdZm6zfGzfXwK7sWmz7JopMJQIiAU8deiqgtYeoMEZl4gtNIjfQljItOR
sFtq6GUtm1Ah67BO2GDTUMx6x+JyZz5E5A8WZiNWvXA0S8spKqcfBOGQK0eGX2oY
bEwZTj3Ut4p+WMdiTSbOCIajTZ0yPRbZM0e1DOYjHgyS9XZbcdbKnkwgOQv+t1W1
H7rIlXPB5BoQzT+k9BeNMoCO1lS9PhKkmmuawg/YhQp2B75gYmMk7vnUPpJ3N80=
=tO1N
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google Groups "qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qubes-users...@googlegroups.com.
To post to this group, send email to qubes...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/20150629094438.GF982%40mail-itl.
For more options, visit https://groups.google.com/d/optout.
>
> Any idea?
>
> Another legacy of template upgrade is that now "sudo yum update" does not
> work anymore if I do not use:
> sudo mount --bind /mnt/removable/modules /usr/lib/modules
> everytime, because
> *there is not enough free space in /usr/lib/modules*
You should not have kernel package installed in the VM. Try to remove
it. If something requires it, you'll see what. Let me know about such
packages.
Yes, this is exactly why those packages shouldn't be installed in the
first place. /lib/modules is provided by dom0 (together with the kernel)
and VM have no direct influence on its content. So files installed there
are not preserved.