LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Moving my Linux installation to VirtualBox (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/moving-my-linux-installation-to-virtualbox-4175724614/)

EmDeeTee 04-30-2023 05:38 AM

Moving my Linux installation to VirtualBox
 
Hi everybody! :)

Lately, I got into making Linux From Scratch. It all went pretty well, but I wanted to make my installation distributable, so I can pack my whole system and send it to somebody or run it in a virtual machine.

A few days ago I completed the base system with general-use libraries and GUI with Xorg. It is all working on my comput00r. So I wanted to pack it for the first time and run it in a VM...

I used
Code:

tar -cvpf --exclude[...] /
I don't have the exact script I used with me right now, but by this --exclude[...] I meant that I excluded some cache directories and Virtual File Systems.

and now I got my very first, shiny tarball :jawa:

So I downloaded VirtualBox (I'm doing this on Windows, but I built my LFS on Gentoo) and made a VM. I've used Arch Live CD to get my tarball situated on there and installed GRUB and finally, booted it up. It worked, I was able to log in and issue commands.

The problem is, that quite quickly my enthusiasm got shot down when I realised there is something wrong with this VM.

I can't build linux kernel inside it, and configure scripts fail when trying to build something else... (I tried it with bash source code).

Here I give you the config.log file from bash: https://pastebin.com/Rrk3i2qv
On line 101 it says something about not being able to find an include. I have no idea why. It works perfectly fine on my PC.

Linux compilation also failed on 'make menuconfig', because it was not able to find <sys/types.h>

wpeckham 05-01-2023 01:38 PM

Did you check that those targets of the includes and library sources were present?
It may be that your excludes happened to exclude something that you need to include OR RECREATE in the new virtual guest.

EmDeeTee 05-01-2023 03:13 PM

Hi! Thanks for your response.

This is what I'm excluding from the tarball.

Code:

--exclude='/home/user/.mozilla/seamonkey/'
--exclude='/home/user/.cache/*'
--exclude='proc/*'
--exclude='sys/*'
--exclude='dev/*'
--exclude='tmp/*'
--exclude='run/*'
--exclude='mnt/*'
--exclude='media/*'

Quote:

Originally Posted by wpeckham (Post 6428277)
Did you check that those targets of the includes and library sources were present?
It may be that your excludes happened to exclude something that you need to include OR RECREATE in the new virtual guest.


EmDeeTee 05-01-2023 03:42 PM

Hold on... I've just found something out...

I tested if the archive contained /usr/include/sys/ ... And it didn't!

I'm sure that no `--exclude` excluded it from the tarball (as you can see above)

So I tested further on I found out that using my current command for packing it up:

Code:

tar cvpf iterkoczeos_snapshot.tar --exclude='/home/user/.mozilla/seamonkey/'        --exclude='/home/user/.cache/*'        --exclude='proc/*'        --exclude='sys/*'        --exclude='dev/*'        --exclude='tmp/*'        --exclude='run/*'        --exclude='mnt/*'        --exclude='media/*' /
Causes /usr/include/sys/ to be skipped. (I'm running this tar command as root, and there are no errors shown)

But when I tar up specifically /usr/include/ then the archive contains the sys/ directory.

Any idea as to why that might happen? What if other files are also skipped and I don't even know about it?

EmDeeTee 05-02-2023 03:50 AM

1 Attachment(s)
I noticed my error. I've used a wildcard instead of the absolute path to the `sys` directory. So it also excluded /usr/include/sys...

I guess the error told me what was wrong, but I tried to search for a deeper cause and never thought to actually check if this header file existed.

But now I have yet another problem with that virtual machine. When I want to start xorg, it closes with an error. The log says something about not being able to load vmware module. I don't know why it tries to load vmware since I'm on VirtualBox. I have also compiled my kernel with support for VirtuaBox GPU. I'm including the Xorg log if anybody wants to take a look at it.

Thanks

wpeckham 05-02-2023 11:11 AM

Vesa should be compatible with the virtual display, and it seems it is not installed. You need SOME compatible display module. Try doing a reconfigure of X to see if it autodetects and activates a working module. IF it does not, you might need to reinstall x.org, or the VBOX video driver, or both. Assuming that one or both are already installed completely, the reconfig of X might just take care of that.

Are you trying to start xorg directly, or using startx, or using xinit?

EmDeeTee 05-03-2023 01:41 AM

Hi! Thanks for your response.

I was able to fix the problem by poking around in the display settings of my virtual machine. It was set to `VMSVGA` and I changed it to `VBoxVGA` and it started working. I am using startx

Quote:

Originally Posted by wpeckham (Post 6428431)
Vesa should be compatible with the virtual display, and it seems it is not installed. You need SOME compatible display module. Try doing a reconfigure of X to see if it autodetects and activates a working module. IF it does not, you might need to reinstall x.org, or the VBOX video driver, or both. Assuming that one or both are already installed completely, the reconfig of X might just take care of that.

Are you trying to start xorg directly, or using startx, or using xinit?


wpeckham 05-03-2023 12:36 PM

Good job!
If you are satisfied, you might want to mark this thread as "solved" now.
That way others can find your solution if they run into the same situation and issue.


All times are GMT -5. The time now is 10:48 PM.