Ask Your Question
1

Move gnome-boxes and libvirt default directory to another drive

asked 2018-06-02 11:54:50 -0500

hhlp gravatar image

updated 2018-06-05 07:01:17 -0500

for space requerimient in my home I need to move this two directory to another drive :

/home/hhlp/.local/share/gnome-boxes
/home/hhlp/.local/share/libvirt

I would like to move to another drive :

sdb               8:16   0 931,5G  0 disk 
└─sdb1            8:17   0 931,5G  0 part /run/media/hhlp/SAMSUNG_1TB

/dev/sdb1             2048 1953521663 1953519616 931,5G  7 HPFS/NTFS/exFAT

How I can apply that...

Regards.,

NOTE : I follow this step :

If you would like to store your Gnome Boxes disks (which can get large) elsewhere, such as on a storage hard drive, you can use a symbolic link to move its location. Create a symbolic link from

~/.local/share/gnome-boxes

to your desired location gnome-boxes and libvirt directory :

rm -rf ~/.local/share/gnome-boxes or libvirt
ln -s /path/to/drive ~/.local/share/gnome-boxes or libvirt

that is how the permisions look like :

ls -lZa /home/hhlp/.local/share/gnome-boxes  
lrwxrwxrwx. 1 hhlp hhlp unconfined_u:object_r:data_home_t:s0 46 jun  2 16:42 /home/hhlp/.local/share/gnome-boxes -> /run/media/hhlp/SAMSUNG_1TB/gnome-boxes/images

ls -lZa /home/hhlp/.local/share/libvirt               
lrwxrwxrwx. 1 hhlp hhlp unconfined_u:object_r:data_home_t:s0 36 jun  2 18:37 /home/hhlp/.local/share/libvirt -> /run/media/hhlp/SAMSUNG_1TB/libvirt/

What I get in gnome-boxes is :

start CentOS-7-x86_64-LiveGNOME-1804: Unable to start domain: internal error: process exited while connecting to monitor: 2018-06-02T16:48:53.008862Z qemu-system-x86_64: -drive file=/home/hhlp/.local/share/gnome-boxes/images/boxes-unknown,format=qcow2,if=none,id=drive-ide0-0-0,cache=writeback: Could not open '/home/hhlp/.local/share/gnome-boxes/images/boxes-unknown': **Permission denied**

NOTE : this idea get to my mind when i read this article in feodra magazine -> getting-started-with-virtualization-in-gnome-boxes

edit retag flag offensive close merge delete

Comments

1

Use ls -lLZa to get the right SELinux labels.

villykruse gravatar imagevillykruse ( 2018-06-02 13:49:48 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2018-06-05 06:45:35 -0500

hhlp gravatar image

updated 2018-06-05 06:48:51 -0500

I finnaly find the solution but i think the problem was is my hd storage NTFS.

I have to format the storage as ext4 :

sdb               8:16   0 931,5G  0 disk 
└─sdb1            8:17   0 931,5G  0 part /mnt/samsung

/dev/sdb1             2048 1953523054 1953521007 931,5G 83 Linux

Change the label :

sudo e2label /dev/sdb1 samsung
sudo mkdir /mnt/samsung

edit /etc/fstab to mount the image by LABEL :

LABEL=samsung /mnt/samsung ext4 defaults 1 2

change the owner and permisions to write in the storage :

sudo chmod -R 777 /mnt/samsung
sudo chown -R hhlp:hhlp /mnt/samsung

move the folder to the new destination :

mv /home/hhlp/.local/share/gnome-boxes  /mnt/samsung/gnome-boxes

make a sylink in your $HOME :

ln -s /mnt/samsung/gnome-boxes /home/hhlp/.local/share/gnome-boxes

NOTE : same step for libvirt folder move folder and make syslink.

Now you can use and manage gnome-boxes images with virt-manager too :

To get started, open Virtual Machine Manager (or install the virt-manager package if it's not already installed), and click File > Add New Connection

image description

Click the drop-down for connection type and choose QEMU/KVM user session and click Connect

image description

You should now see your Boxes appear in the list under the new connection

Regards.,

edit flag offensive delete link more
1

answered 2018-06-02 13:51:58 -0500

villykruse gravatar image

I would also run

restorecon -R -v /home/hhlp/.local
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2018-06-02 11:54:50 -0500

Seen: 1,033 times

Last updated: Jun 05 '18