📜 ⬆️ ⬇️

Installing Gentoo on VDS with Virtuozzo Virtualization

A little over a year ago, I started renting VDS from one company that uses Parallels Virtuozzo Containers with a very limited set of operating systems (Debian, Fedora, Ubuntu, Suse, CentOS) for virtualization. From the entire list to the soul does not lie very much, but still chose Debian, which I had to endure until recently. This moment is finding the Gentoo installation methodology on VDS with this type of virtualization .

So let's get started

The first thing that would not hurt to do is to make a back-up of existing data, if they are of any value. This is done in the VZPP panel at your server_address 4643 /. Further, in the same panel, we transfer VDS to recovery mode and after successful transfer we go via SSH to your VDS. The old file system in recovery mode is in / repair. First, copy the mtab file from there:
cp /repair/etc/mtab /root/mtab.old 

If the old filesystem contains any data that needs to be transferred to the new system with Gentoo, we do:
 cd /repair mkdir old for i in *; do if test old != $i; then mv $i old/; fi; done 

If there is no important data, then we just erase everything:
 cd /repair rm -rf * 

If suddenly / repair is available only for reading (I had OK, but the source mentions what happens and this), then before transferring / deleting we do:
 mount -o remount,rw /repair 

Now everything is ready for downloading Gentoo:
 wget http://mirror.yandex.ru/gentoo-distfiles/releases/x86/current-stage3/stage3-i686-20101019.tar.bz2 wget http://mirror.yandex.ru/gentoo-distfiles/snapshots/portage-latest.tar.bz2 tar xvjpf stage3-*.tar.bz2 tar xvjf portage-*.tar.bz2 -C /repair/usr rm stage3-*.tar.bz2 portage-*.tar.bz2 

Copy the DNS settings and return the mtab in place:
 cp /etc/resolv.conf /repair/etc/ cp /root/mtab.old /repair/etc/mtab 

Everything is ready for chroot in Gentoo:
 mount -t proc proc /repair/proc/ mount -o bind /dev /repair/dev chroot /repair 

Immediately change the root password:

The new password will be valid not only for VDS, but also for the control panel. I also copied my SSH key from the old file system. The download will use baselayout + openrc, which you need to unmask and install (the baselayout will pull openrc itself):
 echo "sys-apps/baselayout ~x86" >> /etc/portage/package.keywords echo "sys-apps/openrc ~x86" >> /etc/portage/package.keywords emerge baselayout 

Now configure the network:
 emerge iproute2 cd /etc/init.d rm net.eth0 ln -s net.lo net.venet0 rc-update add net.venet0 default 

Also add the network configuration in /etc/conf.d/net:
 config_venet0=("87.118.xz/24" "87.118.yz/24") routes_venet0=(" scope link" "default via") 

And add sshd to autorun:
 rc-update add sshd default 

According to my personal observations, the normal launch of VDS also requires the presence of the file / etc / network / interfaces (I previously had Debian, it is possible that the file name will differ for other distributions). Virtuozzo apparently tries to write the current network configuration to it, and if it is impossible to start VDS, it ends with an error. So that:
 mkdir /etc/network touch /etc/network/interfaces 

Now you can finally try to reboot ...
Source: http://log.onthebrink.de/2008/04/gentoo-on-1-vserver.html

Source: https://habr.com/ru/post/107377/

All Articles