https://www.funtoo.org/api.php?action=feedcontributions&user=Hencb&feedformat=atomFuntoo - User contributions [en]2024-03-28T23:19:08ZUser contributionsMediaWiki 1.36.2https://www.funtoo.org/index.php?title=Package:Mattermost_Server_Binary&diff=18705Package:Mattermost Server Binary2017-04-11T16:27:43Z<p>Hencb: Added working openRC script and updated docs to reflect the change.</p>
<hr />
<div>{{Ebuild<br />
|Summary=Mattermost is a free software team communication service.<br />
It brings team messaging and file sharing into one place, accessible across PCs and phones, with archiving and search.<br />
|CatPkg=net-im/mattermost-server-bin<br />
|Homepage=https://about.mattermost.com/download/<br />
}}<br />
{{warning|The ebuild is currently not available. The article will directly use the binaries provided on the Mattermost website}}<br />
<br />
Mattermost is a messaging client that offers persistent storage of messages and file sharing. It also allows integration of audio, video, images, gifs, code snippets into messages as well. It also allows audio and video calls through WebRTC. If IRC was raw text, Mattermost would be its rich text counterpart. Mattermost also works with all major operating systems and is also available as a mobile app and as a webpage. Mattermost can also bridge to IRC, which is a separate topic. We'll cover the basic configuration of Mattermost with MySQL, postfix, NGINX and SSL certificates obtained with Letsencrypt.<br />
<br />
==Prerequisites==<br />
<br />
Mattermost at the moment doesn't seem to support UNIX sockets. While configuring postfix (for user email verification) isn't required in preview mode, it's recommended if you're running Mattermost in production Please see http://www.funtoo.org/Package:Postfix on how to configure Postfix to use ports instead of UNIX sockets.<br />
<br />
Please also see the article on NGINX on how to install it http://www.funtoo.org/Package:Nginx and see the article on how to install mysql http://www.funtoo.org/Package:MySQL<br />
<br />
We'll assume Mattermost, Postfix, NGINX and MySQL are running on the same server. A separate guide on configuring Mattermost to run on multiple servers will be written at a certain point in the future.<br />
We'll assume the domain for Mattermost is chat.example.com, and we're installing Mattermost in /opt/mattermost.<br />
<br />
We'll also assume you correctly obtained the SSL certificates for your website with {{Package:app-crypt/certbot}} and configured NGINX to use them.<br />
<br />
Refer to the RHEL 6.6 guide to installing Mattermost. It'll be heavily referenced here. https://docs.mattermost.com/install/install-rhel-66.html<br />
<br />
==Installing Mattermost binaries==<br />
<br />
Let's get started. First, fetch the Mattermost binaries from the website and install them in /opt:<br />
<br />
{{console|body=<br />
###i## wget https://releases.mattermost.com/3.6.2/mattermost-3.6.2-linux-amd64.tar.gz<br />
}}<br />
{{console|body=<br />
###i## tar -xvf mattermost-3.6.2-linux-amd64.tar.gz -C /opt<br />
}}<br />
<br />
Create the storage directory where all the files and images that are uploaded to Mattermost are stored. We'll use /var/mattermost/data as the data folder:<br />
{{console|body=<br />
###i## mkdir -p /var/mattermost/data<br />
}}<br />
<br />
Edit the main configuration file to point to the right directory for storing files:<br />
{{file|name=/opt/mattermost/config/config.json|desc=main configuration file file|body=<br />
"FileSettings": {<br />
"MaxFileSize": 52428800,<br />
"DriverName": "local",<br />
"Directory": "/var/mattermost/data/",<br />
"EnablePublicLink": false,<br />
}}<br />
<br />
<br />
Create a system user and group called mattermost to run the service:<br />
{{console|body=<br />
###i## sudo useradd --system --user-group mattermost<br />
###i## sudo chown -R mattermost:mattermost /opt/mattermost<br />
###i## sudo chmod -R g+w /opt/mattermost<br />
###i## sudo chown -R mattermost:mattermost /var/mattermost/data<br />
}}<br />
{{warning|Failing to set the correct permissions on the data folder will cause file uploads to fail, as well as forgetting to edit config.json to point to the right folder.}}<br />
<br />
Create the init script:<br />
{{file|name=/etc/init.d/mattermost|desc=openRC init script|body=<br />
#!/sbin/runscript<br />
<br />
command=./platform<br />
pidfile=/var/run/mattermost.pid<br />
<br />
depend() {<br />
need net<br />
use logger dns<br />
}<br />
<br />
start(){<br />
ebegin "starting mattermost"<br />
cd /opt/mattermost/bin<br />
start-stop-daemon --start --quiet --background --exec $command -u mattermost --make-pidfile --pidfile $pidfile<br />
eend $?<br />
}<br />
<br />
stop(){<br />
ebegin "stopping mattermost"<br />
cd /opt/mattermost/bin<br />
start-stop-daemon --stop --quiet --exec $command --pidfile $pidfile<br />
eend $?<br />
}<br />
<br />
}}<br />
The openRC script needs to be enabled and started! This will be done after configuring MySQL and NGINX,<br />
and after editing main configuration file (/opt/mattermost/config/config.json).<br />
<br />
==Configuring MySQL==<br />
Login into MySQL:<br />
{{console|body=<br />
###i## mysql -u root -p<br />
}}<br />
Run the following command to create the mysql user for mattermost:<br />
{{console|body=<br />
mysql> create user 'mmuser'@'%' identified by 'mmuser-password';<br />
}}<br />
the % means to listen on any ip address. This should be changed to a more secure default, like<br />
127.0.0.1 for localhost (because we're running Mattermost on the same server as mysql, it's safe<br />
to change % to 127.0.0.1).<br />
Substitute the values for 'mmuser' and 'mmuser-password' with your own values.<br />
<br />
Create the Mattermost database:<br />
{{console|body=<br />
mysql> create database mattermost;<br />
}}<br />
Grant all privileges on the mattermost database to the user 'mmuser':<br />
{{console|body=<br />
mysql> grant all privileges on mattermost.* to 'mmuser'@'%';<br />
}}<br />
<br />
Exit mysql:<br />
{{console|body=<br />
mysql> quit;<br />
}}<br />
<br />
Check what port mysql is listening on:<br />
{{console|body=<br />
###i## netstat -tlpn<br />
}}<br />
{{console|body=<br />
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 857/mysqld <br />
}}<br />
Mysql is listening on port 3306. We'll need this information in the next step.<br />
<br />
Now we need to configure the main configuration file to tell Mattermost to use MySQL and the created user and table.<br />
{{file|name=/opt/mattermost/config/config.json|desc=main configuration file file|body=<br />
"SqlSettings": {<br />
"DriverName": "mysql",<br />
"DataSource": "mmuser:mmpassword@tcp(127.0.0.1:3306)/mattermost?charset=utf8mb4,utf8",<br />
}}<br />
Save and exit the file.<br />
Test that Mattermost is working:<br />
{{console|body=<br />
###i## sudo -u mattermost ./platform<br />
}}<br />
When the server starts, it will show some log information and the text:<br />
{{console|body=<br />
###i## Server is listening on :8065<br />
}}<br />
You can also verify that mattermost is running with curl (which will display the HTML returned by Mattermost):<br />
{{console|body=<br />
###i## curl localhost:8065<br />
}}<br />
<br />
You can stop the server by typing CTRL+C in the console. If you're only doing development with Mattermost,<br />
you can skip configuring NGINX as a proxy in the next step and immediately enable the mattermost init script:<br />
<br />
{{console|body=<br />
###i## rc-update add mattermost default<br />
###i## rc<br />
}}<br />
<br />
==Configuring NGINX==<br />
We will proxy the http content served by Mattermost to be served by NGINX over https. To do that, use <br />
the following configuration:<br />
{{file|name=/etc/nginx/sites-available/mattermost|desc=NGINX mattermost file|body=<br />
server {<br />
listen 80;<br />
server_name chat.example.com;<br />
return 301 https://$host$request_uri;<br />
}<br />
<br />
upstream backend {<br />
server 127.0.0.1:8065;<br />
}<br />
<br />
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;<br />
<br />
server {<br />
<br />
# SSL configuration<br />
listen 443 ssl http2;<br />
listen [::]:443 ssl http2;<br />
<br />
root /var/www/example.com/chat;<br />
index index.html index.htm;<br />
server_name chat.example.com;<br />
<br />
ssl_certificate /etc/letsencrypt/live/chat.example.com/fullchain.pem;<br />
ssl_certificate_key /etc/letsencrypt/live/chat/example.com/privkey.pem;<br />
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;<br />
ssl_prefer_server_ciphers on;<br />
ssl_dhparam /etc/ssl/certs/dhparam.pem;<br />
<br />
ssl_ciphers EECDH+CHACHA22:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;<br />
ssl_session_timeout 1h;<br />
ssl_session_cache shared:SSL:50m;<br />
ssl_stapling on;<br />
ssl_stapling_verify on;<br />
#optional, be very careful about this setting! HSTS can render your website inaccessible<br />
#add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload";<br />
<br />
location /api/v3/users/websocket {<br />
proxy_set_header Upgrade $http_upgrade;<br />
proxy_set_header Connection "upgrade";<br />
client_max_body_size 50M;<br />
proxy_set_header Host $http_host;<br />
proxy_set_header X-Real-IP $remote_addr;<br />
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />
proxy_set_header X-Forwarded-Proto $scheme;<br />
proxy_set_header X-Frame-Options SAMEORIGIN;<br />
proxy_buffers 256 16k;<br />
proxy_buffer_size 16k;<br />
proxy_read_timeout 600s;<br />
proxy_pass http://backend;<br />
}<br />
<br />
location / {<br />
client_max_body_size 50M;<br />
proxy_set_header Connection "";<br />
proxy_set_header Host $http_host;<br />
proxy_set_header X-Real-IP $remote_addr;<br />
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />
proxy_set_header X-Forwarded-Proto $scheme;<br />
proxy_set_header X-Frame-Options SAMEORIGIN;<br />
proxy_buffers 256 16k;<br />
proxy_buffer_size 16k;<br />
proxy_read_timeout 600s;<br />
proxy_cache mattermost_cache;<br />
proxy_cache_revalidate on;<br />
proxy_cache_min_uses 2;<br />
proxy_cache_use_stale timeout;<br />
proxy_cache_lock on;<br />
proxy_pass http://backend;<br />
}<br />
location ~ /.well-known {<br />
allow all;<br />
}<br />
}<br />
<br />
}}<br />
You can remove the http2 part in the listen directive if you don't want to use http2 to serve content or if you haven't compiled NGINX with http2 support.<br />
<br />
Link the above configuration to the sites-enabled folder of nginx for the configuration to become active:<br />
{{console|body=<br />
###i## ln -s /etc/nginx/sites-available/mattermost /etc/nginx/sites-enabled/mattermost<br />
}}<br />
{{warning|Make sure you're using absolute paths if you're unfamiliar with symlinks. Relative paths can result in broken symlinks. E.g. ln -s sites-available/mattermost ../sites-enabled/mattermost will result in a broken symlink. The correct way to do is from the sites-enabled folder: ln -s ../sites-available/mattermost . Broken symlinks show up red in most terminals, real symlinks are usually cyan.}}<br />
<br />
Test that the configuration is correct:<br />
{{console|body=<br />
###i## nginx -t<br />
}}<br />
Resolve any errors that might arise.<br />
Make sure you started nginx:<br />
{{console|body=<br />
###i## service nginx start <br />
}}<br />
And then reload the nginx configuration:<br />
{{console|body=<br />
###i## service nginx reload<br />
}}<br />
<br />
Start Mattermost:<br />
{{console|body=<br />
###i## rc-update add mattermost default<br />
###i## rc<br />
}}<br />
<br />
Mattermost should now be available on chat.example.com. <br />
<br />
==Finishing the install==<br />
The first user to register is granted system administrator privileges and access to the System Console.<br />
Create a new team and register as the first user. <br />
If everything went fine, you'll be running in Preview mode. To disable preview mode, you will need to enable email support.<br />
<br />
You will want to access the System Console by clicking on the ... (three dots) icon near the top left corner.<br />
Go to System Console > Notifications > Email and set the following values(for postfix):<br />
{{console|body=<br />
Set Enable Email Notifications to true<br />
Set Notification Display Name to No-Reply<br />
Set Notification From Address to mattermost@example.com<br />
Set SMTP Server Username to (empty)<br />
Set SMTP Server Password to (empty)<br />
Set SMTP Server to localhost<br />
Set SMTP Server Port to 25<br />
Set Connection Security to None<br />
<br />
}}<br />
Save the Settings and send yourself a test email. If you receive the email, you have correctly configured postfix to send Mattermost emails. They're important for email verification and password recovery, so be sure to configure it properly before going live!<br />
<br />
Hopefully you've correctly configured Mattermost with this guide. Happy chatting!<br />
If you get stuck with the install, please consider the options available listed under http://www.funtoo.org/Getting_help<br />
{{EbuildFooter}}</div>Hencbhttps://www.funtoo.org/index.php?title=Xen&diff=18694Xen2017-04-09T15:25:17Z<p>Hencb: /* Get latest portage tree from the snapshots firectory */</p>
<hr />
<div>'''Funtoo Xen Fun'''<br />
We are talking about Xen on Funtoo Linux and how to setup Xen virtualization properly.<br />
Especially, we are going to show you how much fun it is to work with Xen hosts and domU's and <br />
setting up a Funtoo Xen Server without general clicky GUI's or other frontends. This is true hardcore OS Xen setup especially for NOC server systems, headless servers, etc..<br />
<br />
= Funtoo Xen Server with paravirt funtoo domU =<br />
'''Assumptions'''<br />
''We build a 64bit headless XEN hypervisor rockstable and rocket fast with a funtoo headless 64bit paravirt domU.''<br />
We are '''not''' building Xen with pvgrub or hvm (which is kinda slow and overhead as long as you don't want to install Windoze).<br />
<br />
== Buiding Funtoo Xen Host Dom0 ==<br />
Most of the necessary steps are covered in the Installation Tutorial.<br />
We only do outline here the steps that are necessary to enjoy an easy and successful Dom0 setup or if something differs from the normal installation tutorial.<br />
<br />
Please, open in a second tab the [[Installation (Tutorial)|Installation Tutorial]] and follow in both carefully the next steps!<br />
<br />
=== Basic Funtoo Xen Host Dom0 setup ===<br />
<br />
I recommend you use only stable packages for the host dom0 !<br />
<br />
Please consider the decision carefully. I can't stress out enough, you will avoid a lot of problems taking the stable distrib as dom0.<br />
The domU guests could be either unstable or hardened, as you wish! There comes the true fun part ;-)<br />
That's why I first edit my make.conf befor building anything!<br />
<br />
Here is how I set up the system basics:<br />
Disk is <tt>/dev/sda</tt><br />
<br />
<pre><br />
/dev/sda1 is our / partition ca 20GB ext4 <br />
/dev/sda2 is our swap partition ca 4GB<br />
/dev/sda3 holds the lvm volume group vgxen<br />
</pre><br />
<br />
I am using volume groups over raid - which I strongly advice to everybody.<br />
<br />
Store of xen stuff: <br />
<pre>/etc/xen/ --> xend configuration files<br />
/xen/configs/ --> my xen domU configuration files folder <br />
/xen/kernel/ --> my xen domU kernel folder <br />
/xen/disks/ --> my xen domU image files folder<br />
</pre><br />
<br />
Edit <tt>/etc/rc.conf</tt> and uncomment the line at the bottom for rc_sys<br />
<pre>rc_sys="xen0"</pre><br />
<br />
== Configure and Build Xen Dom0 Kernel ==<br />
<console><br />
###i## emerge gentoo-sources<br />
###i## cd /usr/src/linux<br />
###i## make menuconfig<br />
</console><br />
<br />
These settings are current as of 3.2.1-gentoo-r2, other versions may vary:<br />
<br />
{{kernelop<br />
|title=<br />
|desc=<br />
General setup ---><br />
<*> Kernel .config support<br />
[*] Enable access to .config through /proc/config.gz<br />
<br />
Processor type and features ---> <br />
[*] Paravirtualized guest support ---> <br />
[*] Xen guest support<br />
<br />
Bus options (PCI etc.) ---><br />
[*] Xen PCI Frontend <br />
<br />
[*] Networking support ---><br />
Networking options ---><br />
<*> 802.1d Ethernet Bridging<br />
<br />
Device Drivers ---> <br />
[*] Block devices (NEW) ---><br />
<M> DRBD Distributed Replicated Block Device support<br />
< > Xen virtual block device support<br />
<*> Xen block-device backend driver<br />
<br />
Device Drivers ---> <br />
[*] Network device support ---> <br />
< > Xen network device frontend driver <br />
<*> Xen backend network device<br />
<br />
Device Drivers ---><br />
Graphics support ---><br />
-*- Support for frame buffer devices ---<br />
< > Xen virtual frame buffer support<br />
<br />
Device Drivers ---> <br />
Xen driver support ---> <br />
[*] Xen memory balloon driver (NEW) <br />
[*] Scrub pages before returning them to system (NEW) <br />
<*> Xen /dev/xen/evtchn device (NEW) <br />
[*] Backend driver support (NEW) <br />
<*> Xen filesystem (NEW) <br />
[*] Create compatibility mount point /proc/xen (NEW) <br />
[*] Create xen entries under /sys/hypervisor (NEW) <br />
<M> userspace grant access device driver (NEW) <br />
<M> User-space grant reference allocator driver (NEW) <br />
<M> xen platform pci device driver (NEW)<br />
<br />
File systems ---><br />
< > Ext3 journalling file system support<br />
<*> The Extended 4 (ext4) filesystem<br />
[*] Use ext4 for ext2/ext3 file systems (NEW)<br />
[*] Ext4 extended attributes (NEW)<br />
}}<br />
{{Fancyimportant|Don't forget to add the required drivers for your networking and sata cards. If you use RAID, make sure to add the correct CONFIG_MD_RAID* entries to your config.}}<br />
<br />
<console><br />
###i## make<br />
###i## make modules_install<br />
</console><br />
<br />
{{Fancynote| If you experience issues with connecting to the console ensure the module "xen_gntdev" (userspace grant access device driver) is loaded before the xenconsoled process is started (you may have to restart it after loading the module).}}<br />
<br />
== Configuring Grub ==<br />
Work has been completed to automatically enable Xen Grub entries, so after you copy your dom0 kernel edit your /etc/boot.conf as follows:<br />
<br />
<pre><br />
"Funtoo on Xen" {<br />
type xen<br />
xenkernel xen.gz<br />
xenparams loglvl=all guest_loglvl=all xsave=1 iommu=1 iommu_inclusive_mapping=1 dom0_max_vcpus=2 dom0_vcpus_pin dom0_mem=4096M <br />
kernel kernel[-v]<br />
params += quiet<br />
}<br />
</pre><br />
<br />
{{Fancynote| iommu is the paravirtualized instructions, if your motherboard or CPU does not support VT-d do, not enable it. Xsave saves the supported CPU instruction sets -- without it you're dom0 kernel may not boot. dom0_vcpus_pin permanatly assigns cpu's to dom0 -- increasing performance.}}<br />
<br />
== Basic Networking with the Dom0 ==<br />
Funtoo Linux offers its own modular, template-based network configuration system. This system offers a lot of flexibility for configuring network interfaces, essentially serving as a "network interface construction kit."<br />
<br />
We are going to set eth0 as the default interface to the outside world for now. eth1 will be part of a bridge (xenbr0) that is going to be used by various domU guests.<br />
<br />
Construct the interfaces:<br />
<console><br />
###i## cd /etc/init.d/<br />
###i## ln -s netif.tmpl netif.xenbr0<br />
###i## ln -s netif.tmpl netif.extbr0<br />
###i## ln -s netif.tmpl netif.eth0<br />
###i## ln -s netif.tmpl netif.eth1<br />
###i## rc-update add netif.xenbr0 sysinit<br />
###i## rc-update add netif.extbr0 sysinit<br />
</console><br />
<br />
Make sure dhcpcd, eth0 and eth1 don't start at boot:<br />
<console><br />
###i## rc-update del dhcpcd sysinit<br />
###i## rc-update del netif.eth0 sysinit<br />
###i## rc-update del netif.eth1 sysinit<br />
</console><br />
<br />
Configure the slave interfaces:<br />
<console><br />
###i## cd /etc/conf.d/<br />
###i## echo 'template="interface-noip"' > netif.eth0<br />
###i## echo 'template="interface-noip"' > netif.eth1<br />
</console><br />
Now, we prepare the bridges:<br />
<console><br />
###i## nano netif.xenbr0<br />
</console><br />
here we set the internal Xen bridge by editing <tt>/etc/conf.d/netif.xenbr0</tt>:<br />
<br />
<pre><br />
template="bridge"<br />
ipaddr="10.0.1.200/24"<br />
gateway="10.0.1.1"<br />
nameservers="10.0.1.1 10.0.1.2"<br />
domain="funtoo.org"<br />
slaves="netif.eth0"<br />
</pre><br />
<br />
Then, we set up the external interface:<br />
<console><br />
###i## nano netif.extbr0<br />
</console><br />
{{Fancynote| This will look quite similar. Please watch out for the correct slave setting!}}<br />
<br />
Now, edit <tt>/etc/conf.d/netif.extbr0</tt>:<br />
<br />
<br />
<pre><br />
template="bridge"<br />
ipaddr="10.0.1.201/24"<br />
gateway="10.0.1.1"<br />
nameservers="10.0.1.1 10.0.1.2"<br />
domain="funtoo.org"<br />
slaves="netif.eth1"<br />
</pre><br />
<br />
This gives us the possibility to play around with various setups later, it's modular and easy to tweak and change.<br />
<br />
{{Fancytip| It is probably a good idea to try starting the interfaces with rc before rebooting.}}<br />
<br />
== Basic Networking with domU ==<br />
<br />
The easiest way is to let Xen set up the networking. But if everything is up and running it is not possible to change the routings, etc.<br />
Letting Xen do the bridges will be obsolete in the near future. So this is not the recommended way anymore. As we already set up the bridges in the previous section it may be enough to comment everything network related. If not, just un-comment the last lines.<br />
<br />
We edit the /etc/xen/xend-config.sxp<br />
<br />
<pre><br />
#### Xen config from maiwald.tk - Xen 4.x Network in bridge mode<br />
<br />
(logfile /var/log/xen/xend.log)<br />
(loglevel DEBUG)<br />
<br />
(xend-relocation-server no)<br />
(xend-relocation-hosts-allow '^localhost$ ^localhost\\.localdomain$')<br />
<br />
# The limit (in kilobytes) on the size of the console buffer<br />
(console-limit 1024)<br />
<br />
(dom0-min-mem 384)<br />
(enable-dom0-ballooning no)<br />
<br />
(total_available_memory 0)<br />
(dom0-cpus 0)<br />
<br />
(vncpasswd 'geheim')<br />
<br />
# let xen create the net<br />
# (network-script network-bridge)<br />
# (vif-script vif-bridge)<br />
<br />
# we create the net - new default in Xen 4<br />
#<br />
#(network-script 'network-bridge netdev=eth0 bridge=xenbr0 vifnum=0')<br />
#(vif-script vif-bridge bridge=xenbr0)<br />
</pre><br />
<br />
= Building the Funtoo Xen DomU Container =<br />
<br />
We are going to build the DomU now, preparing first from outside the domU.<br />
<br />
=== create lvm volume or partition or image file ===<br />
<br />
''This is a stub, please help completing this guide here!''<br />
<br />
<console><br />
###i## vgcreate vgxen /dev/sda3<br />
###i## lvcreate -L10G -n funtoo_root vgxen<br />
###i## lvcreate -L1G -n funtoo_swap vgxen<br />
###i## vgchange -a y<br />
###i## mkfs.ext4 -L funtoo_root /dev/vgxen/funtoo_root<br />
###i## mkswap -L funtoo_swap /dev/vgxen/funtoo_swap<br />
###i## rc-update add lvm boot<br />
</console><br />
== Basic DomU System setup ==<br />
=== mount domU lvm volume or physical partition or image file===<br />
<console><br />
###i## mkdir /mnt/domu1<br />
###i## mount /dev/vgxen/funtoo_root /mnt/domu1<br />
###i## cd /mnt/domu1<br />
</console><br />
<br />
=== get stage3 ===<br />
from a funtoo mirror near you, I suggest you look at the funtoo homepage<br />
<br />
<console><br />
###i## links http://www.funtoo.org/wiki/Download </console><br />
Then choose a mirror near you ( I use Heanet in EU ) and look for the right stage3. I use XEON CPUs so I take the core2 distrib:<br />
<br />
<console><br />
###i## wget -cv http://ftp.heanet.ie/mirrors/funtoo/funtoo-stable/x86-64bit/core2_64/stage3-latest.tar.xz </console><br />
Unfortunately I can't find md5sums or similar which is really unpleasant.<br />
<br />
=== Get latest portage tree from the snapshots directory ===<br />
<br />
<console><br />
###i## wget -cv http://ftp.heanet.ie/mirrors/funtoo/funtoo-stable/snapshots/portage-current.tar.xz </console><br />
<br />
=== Extract the stage3 ===<br />
<console><br />
###i## tar xpf stage3-current.tar.xz<br />
</console><br />
<br />
=== Extract Portage ===<br />
<br />
<console><br />
###i## cd usr<br />
###i## tar xf ../portage-current.tar.xz<br />
</console><br />
<br />
== Preparing the chroot environment ==<br />
=== Editing the make.conf ===<br />
copy the <tt>/etc/make.conf</tt> from dom0 and adjust it:<br />
<br />
<console><br />
###i## cp /etc/portage/make.conf /mnt/domu1/etc/<br />
</console><br />
<br />
make sure to adjust MAKEOPTS to your assigned CPUs (rule of thumb: cpu cores +1 - yes, even in XEN)<br />
<console><br />
###i## nano -w /mnt/domu1/etc/portage/make.conf<br />
</console><br />
out there the MAKEOPTS variable in:<br />
<pre><br />
MAKEOPTS="-j2"<br />
</pre><br />
<br />
=== Copy <tt>/etc/resolv.conf</tt> === <br />
<console><br />
###i## cp -L /etc/resolv.conf /mnt/domu1/etc/<br />
</console><br />
<br />
=== mount proc and dev === <br />
<console><br />
###i## mount -t proc none /mnt/domu1/proc<br />
###i## mount --rbind /dev /mnt/domu1/dev <br />
</console><br />
<br />
== Building Funtoo Xen Guest(s) DomU ==<br />
<br />
== Final DomU System setup ==<br />
=== chroot === <br />
<console><br />
###i## chroot /mnt/domu1 /bin/bash<br />
###i## env-update<br />
###i## source /etc/profile<br />
###i## export PS1="(domU-chroot) $PS1"<br />
</console><br />
<br />
=== sync portage === <br />
<console> <br />
###i## emerge --sync<br />
</console><br />
<br />
=== set locales === <br />
<console><br />
###i## nano -w /etc/locale.gen<br />
###i## locale-gen<br />
</console><br />
<br />
=== Set your timezone === <br />
(choose your timezone in <tt>/usr/share/zoneinfo</tt>)<br />
<console><br />
###i## ln -v -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime<br />
</console><br />
<br />
=== Edit <tt>/etc/fstab</tt> (see also gentoo handbook as reference) === <br />
We assume that we name our root partition <tt>xvda1</tt> and the swap partition <tt>xvda2</tt> in our <tt>domU-xen-</tt> config (we will do that later)<br />
<console><br />
###i## nano -w /etc/fstab<br />
</console><br />
<br />
<pre><br />
/dev/xvda1 / ext4 noatime 0 1<br />
/dev/xvda2 none swap sw 0 0<br />
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0<br />
</pre><br />
<br />
=== The most important stuff === <br />
Copy this into your terminal:<br />
<br />
<pre><br />
echo '<br />
Larry loves Funtoo<br />
_________________________<br />
< Have you mooed today? ><br />
-------------------------<br />
\ ^__^<br />
\ (oo)\_______<br />
(__)\ )\/\<br />
||----w |<br />
|| ||<br />
.::::::::::::::: WELCOME TO ^^^^^^^^^^^^^^^^^^^:::::::::::::..<br />
...............................................................<br />
:########:'##::::'##:'##::: ##:'########::'#######:::'#######::.<br />
:##.....:: ##:::: ##: ###:: ##:... ##..::'##.... ##:'##.... ##::<br />
:##::::::: ##:::: ##: ####: ##:::: ##:::: ##:::: ##: ##:::: ##::<br />
:######::: ##:::: ##: ## ## ##:::: ##:::: ##:::: ##: ##:::: ##::<br />
:##...:::: ##:::: ##: ##. ####:::: ##:::: ##:::: ##: ##:::: ##::<br />
:##::::::: ##:::: ##: ##:. ###:::: ##:::: ##:::: ##: ##:::: ##::<br />
:##:::::::. #######:: ##::. ##:::: ##::::. #######::. #######::′<br />
.::::::::::.......:::..::::..:::::..::::::.......::::.......::´ <br />
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .<br />
'> /etc/motd<br />
</pre><br />
We are using the echo instead of „emerge --moo „ as larry still moo's in gentoo'ish<br />
<br />
So that's it - almost.<br />
<br />
==== Adding networking to the domU: ====<br />
<br />
<console><br />
(domU-chroot) ###i## cd /etc/init.d/<br />
(domU-chroot) ###i## ln -sf netif.tmpl netif.eth0<br />
(domU-chroot) ###i## rc-update add netif.eth0<br />
* service netif.eth0 added to runlevel sysinit<br />
</console><br />
<br />
==== Now we are ready for the final setups ====<br />
<console><br />
(domU-chroot) ###i## emerge eix<br />
(domU-chroot) ###i## eix-update <br />
Reading Portage settings ..<br />
Building database (/var/cache/eix) ..<br />
[0] "gentoo" /usr/portage/ (cache: metadata-md5-or-flat)<br />
Reading category 154|154 (100%) Finished <br />
Applying masks ..<br />
Calculating hash tables ..<br />
Writing database file /var/cache/eix ..<br />
Database contains 15729 packages in 154 categories.<br />
<br />
(domU-chroot) # exit <br />
exit<br />
</console><br />
<br />
From here you have to decide how you want to run your domU: with unpriviledged users and sudo or with a root account enabled or as a webserver or firewall.<br />
<br />
I always install the openssh server and just place my ssh keys in there. From there the steps differ.<br />
<br />
<console><br />
(dom0-xen) ###i## cp /root/.ssh/authorized_keys /mnt/domu1/root/.ssh/<br />
</console><br />
Also, don't forget to enable PubKeyAuth in your sshd_config in your domU and set <tt>PermitRootLogin</tt> to yes!<br />
<br />
'''Double checking''': Does your domU use kernel modules or not? If you haven't built a monolitic kernel you should copy the modules from the dom0 to the domU now:<br />
<console><br />
(dom0-xen) ###i## mkdir /mnt/domu1/lib/modules<br />
(dom0-xen) ###i## rsync -aP /lib/modules/2.6.38-xen-maiwald.tk-dom0 /mnt/domu1/lib/modules/<br />
</console><br />
<br />
Don't forget to clean up the mounts!<br />
<br />
<console><br />
(dom0-xen) ###i## cd<br />
(dom0-xen) ###i## umount -l /mnt/domu1/proc<br />
(dom0-xen) ###i## umount -l /mnt/domu1/dev<br />
(dom0-xen) ###i## umount -l /mnt/domu1<br />
</console><br />
<br />
=== Booting the Xen DomU Guest ===<br />
<br />
Ok, let's try the first boot of the newly created Xen DomU in Funtoo!<br />
<br />
<console><br />
(dom0-xen) ###i## cd /xen<br />
(dom0-xen) ###i## xm create -c configs/funtoo.cfg<br />
</console><br />
Huuuuiiiii.....<br />
<pre><br />
Using config file "./configs/funtoo.cfg".<br />
Started domain funtoo (id=4)<br />
[ 0.000000] Linux version 2.6.38-xen-maiwald.tk-domU (root@xen) (gcc version 4.4.5 (Gentoo 4.4.5 p1.0, pie-0.4.5) ) #4 SMP Wed Feb 8 17:30:33 CET 2012<br />
[ 0.000000] Command line: root=/dev/xvda1 ro ip=217.x.x.211:127.0.255.255:217.x.x.1:255.255.255.0:domU:eth0:off xencons=tty console=xvc0 raid=noautodetect<br />
[ 0.000000] Xen-provided physical RAM map:<br />
[ 0.000000] Xen: 0000000000000000 - 0000000040800000 (usable)<br />
[ 0.000000] NX (Execute Disable) protection: active<br />
[ 0.000000] last_pfn = 0x40800 max_arch_pfn = 0x80000000<br />
[ 0.000000] init_memory_mapping: 0000000000000000-0000000040800000<br />
[ 0.000000] Zone PFN ranges:<br />
[ 0.000000] DMA 0x00000000 -> 0x00001000<br />
[ 0.000000] DMA32 0x00001000 -> 0x00100000<br />
[ 0.000000] Normal empty<br />
[ 0.000000] Movable zone start PFN for each node<br />
[ 0.000000] early_node_map[2] active PFN ranges<br />
[ 0.000000] 0: 0x00000000 -> 0x00040000<br />
[ 0.000000] 0: 0x00040800 -> 0x00040800<br />
[ 0.000000] setup_percpu: NR_CPUS:16 nr_cpumask_bits:16 nr_cpu_ids:1 nr_node_ids:1<br />
[ 0.000000] PERCPU: Embedded 18 pages/cpu @ffff88003efc0000 s42304 r8192 d23232 u73728<br />
[ 0.000000] Swapping MFNs for PFN 6d6 and 3efc7 (MFN 15deb0 and 1223bf)<br />
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 256109<br />
[ 0.000000] Kernel command line: root=/dev/xvda1 ro ip=217.171.190.211:127.0.255.255:217.171.190.1:255.255.255.0:alyx1:eth0:off xencons=tty console=xvc0 raid=noautodetect<br />
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)<br />
[ 0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)<br />
[ 0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)<br />
[ 0.000000] Software IO TLB disabled<br />
[ 0.000000] Memory: 1022732k/1056768k available (3657k kernel code, 8192k absent, 25844k reserved, 1261k data, 264k init)<br />
[ 0.000000] SLUB: Genslabs=15, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1<br />
[ 0.000000] Hierarchical RCU implementation.<br />
[ 0.000000] NR_IRQS:96<br />
[ 0.000000] Xen reported: 2992.570 MHz processor.<br />
[ 0.000000] Console: colour dummy device 80x25<br />
[ 0.000000] console [tty-1] enabled<br />
[ 0.150003] Calibrating delay using timer specific routine.. 6018.63 BogoMIPS (lpj=30093193)<br />
[ 0.150008] pid_max: default: 32768 minimum: 301<br />
[ 0.150034] Mount-cache hash table entries: 256<br />
[ 0.150173] SMP alternatives: switching to UP code<br />
[ 0.170232] Freeing SMP alternatives: 20k freed<br />
[ 0.170342] Brought up 1 CPUs<br />
[ 0.170377] devtmpfs: initialized<br />
[ 0.170601] xor: automatically using best checksumming function: generic_sse<br />
[ 0.220004] generic_sse: 7325.200 MB/sec<br />
[ 0.220008] xor: using function: generic_sse (7325.200 MB/sec)<br />
[ 0.220091] NET: Registered protocol family 16<br />
[ 0.220186] Brought up 1 CPUs<br />
[ 0.220217] bio: create slab <bio-0> at 0<br />
[ 0.390014] raid6: int64x1 2353 MB/s<br />
[ 0.560003] raid6: int64x2 2964 MB/s<br />
[ 0.730026] raid6: int64x4 2357 MB/s<br />
[ 0.900012] raid6: int64x8 2116 MB/s<br />
[ 1.070007] raid6: sse2x1 5349 MB/s<br />
[ 1.240009] raid6: sse2x2 5404 MB/s<br />
[ 1.410005] raid6: sse2x4 8597 MB/s<br />
[ 1.410008] raid6: using algorithm sse2x4 (8597 MB/s)<br />
[ 1.410022] suspend: event channel 6<br />
[ 1.410022] xen_mem: Initialising balloon driver.<br />
[ 1.410096] Switching to clocksource xen<br />
[ 1.410125] FS-Cache: Loaded<br />
[ 1.410152] CacheFiles: Loaded<br />
[ 1.410268] NET: Registered protocol family 2<br />
[ 1.410288] IP route cache hash table entries: 32768 (order: 6, 262144 bytes)<br />
[ 1.410391] TCP established hash table entries: 131072 (order: 9, 2097152 bytes)<br />
[ 1.410951] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)<br />
[ 1.411180] TCP: Hash tables configured (established 131072 bind 65536)<br />
[ 1.411183] TCP reno registered<br />
[ 1.411186] UDP hash table entries: 512 (order: 2, 16384 bytes)<br />
[ 1.411192] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)<br />
[ 1.411229] NET: Registered protocol family 1<br />
[ 1.411290] platform rtc_cmos: registered platform RTC device (no PNP device found)<br />
[ 1.411401] Intel AES-NI instructions are not detected.<br />
[ 1.411437] audit: initializing netlink socket (disabled)<br />
[ 1.411444] type=2000 audit(1330014455.606:1): initialized<br />
[ 1.412612] fuse init (API version 7.16)<br />
[ 1.412674] msgmni has been set to 2048<br />
[ 1.412990] NET: Registered protocol family 38<br />
[ 1.413018] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)<br />
[ 1.413024] io scheduler noop registered (default)<br />
[ 1.413026] io scheduler deadline registered<br />
[ 1.413049] io scheduler cfq registered<br />
[ 1.413079] Non-volatile memory driver v1.3<br />
[ 1.413088] Hangcheck: starting hangcheck timer 0.9.1 (tick is 180 seconds, margin is 60 seconds).<br />
[ 1.413090] Hangcheck: Using getrawmonotonic().<br />
[ 1.419520] Switched to NOHz mode on CPU #0<br />
[ 1.423394] brd: module loaded<br />
[ 1.423665] loop: module loaded<br />
[ 1.423771] nbd: registered device at major 43<br />
[ 1.426180] Xen virtual console successfully installed as tty1<br />
[ 1.426216] Event-channel device installed.<br />
[ 1.441658] netfront: Initialising virtual ethernet driver.<br />
[ 1.444972] xen-vbd: registered block device major 202<br />
[ 1.444988] blkfront: xvda1: barriers enabled<br />
[ 1.450287] Setting capacity to 20971520<br />
[ 1.450294] xvda1: detected capacity change from 0 to 10737418240<br />
[ 1.450677] blkfront: xvda2: barriers enabled<br />
[ 1.451661] Setting capacity to 2097152<br />
[ 1.451665] xvda2: detected capacity change from 0 to 1073741824<br />
[ 1.452020] bonding: Ethernet Channel Bonding Driver: v3.7.0 (June 2, 2010)<br />
[ 1.452023] bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.<br />
[ 1.453016] i8042: No controller found<br />
[ 1.453066] mousedev: PS/2 mouse device common for all mice<br />
[ 1.453113] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0<br />
[ 1.453145] rtc_cmos: probe of rtc_cmos failed with error -38<br />
[ 1.453155] md: linear personality registered for level -1<br />
[ 1.453158] md: raid0 personality registered for level 0<br />
[ 1.453161] md: raid1 personality registered for level 1<br />
[ 1.453163] md: raid6 personality registered for level 6<br />
[ 1.453166] md: raid5 personality registered for level 5<br />
[ 1.453168] md: raid4 personality registered for level 4<br />
[ 1.453224] device-mapper: uevent: version 1.0.3<br />
[ 1.453273] device-mapper: ioctl: 4.19.1-ioctl (2011-01-07) initialised: dm-devel@redhat.com<br />
[ 1.453340] device-mapper: multipath: version 1.2.0 loaded<br />
[ 1.453343] device-mapper: multipath round-robin: version 1.0.0 loaded<br />
[ 1.453345] device-mapper: multipath queue-length: version 0.1.0 loaded<br />
[ 1.453347] device-mapper: multipath service-time: version 0.2.0 loaded<br />
[ 1.453396] Netfilter messages via NETLINK v0.30.<br />
[ 1.453410] nf_conntrack version 0.5.0 (8192 buckets, 32768 max)<br />
[ 1.453478] ctnetlink v0.93: registering with nfnetlink.<br />
[ 1.453486] IPv4 over IPv4 tunneling driver<br />
[ 1.453548] TCP westwood registered<br />
[ 1.453550] TCP highspeed registered<br />
[ 1.453552] TCP htcp registered<br />
[ 1.453553] TCP vegas registered<br />
[ 1.453555] Initializing XFRM netlink socket<br />
[ 1.453630] NET: Registered protocol family 10<br />
[ 1.453803] IPv6 over IPv4 tunneling driver<br />
[ 1.453863] NET: Registered protocol family 17<br />
[ 1.453868] NET: Registered protocol family 15<br />
[ 1.453870] Registering the dns_resolver key type<br />
[ 1.550094] /usr/src/linux-2.6.38-xen/drivers/rtc/hctosys.c: unable to open rtc device (rtc0)<br />
[ 3.070104] IP-Config: Complete:<br />
[ 3.070109] device=eth0, addr=217.171.190.211, mask=255.255.255.0, gw=217.171.190.1,<br />
[ 3.070116] host=alyx1, domain=, nis-domain=(none),<br />
[ 3.070119] bootserver=127.0.255.255, rootserver=127.0.255.255, rootpath=<br />
[ 3.070212] md: Skipping autodetection of RAID arrays. (raid=autodetect will force)<br />
[ 3.107309] EXT4-fs (xvda1): mounted filesystem with ordered data mode. Opts: (null)<br />
[ 3.107321] VFS: Mounted root (ext2 filesystem) readonly on device 202:1.<br />
[ 3.140059] devtmpfs: mounted<br />
[ 3.140239] Freeing unused kernel memory: 264k freed<br />
INIT: version 2.88 booting<br />
<br />
OpenRC 0.8.3 is starting up Funtoo Linux (x86_64)<br />
<br />
* Mounting /proc ...<br />
[ ok ]<br />
* WARNING: rc_sys not defined in rc.conf. Falling back to automatic detection<br />
* Caching service dependencies ...<br />
[ ok ]<br />
* Mounting /sys ...<br />
[ ok ]<br />
* udev: /dev already mounted, skipping...<br />
* Mounting /dev/pts ...<br />
[ ok ]<br />
* Mounting /dev/shm ...<br />
[ ok ]<br />
* Bringing up network interface lo ...<br />
RTNETLINK answers: File exists<br />
[ ok ]<br />
* Bringing up network interface lo ...<br />
RTNETLINK answers: File exists<br />
RTNETLINK answers: File exists<br />
[ ok ]<br />
* Starting udevd daemon ...<br />
* Populating /dev with existing devices through uevents ...<br />
[ ok ]<br />
* Autoloaded 0 module(s)<br />
* Checking local filesystems ...<br />
funtoo_root: Superblock last write time is in the future.<br />
(by less than a day, probably due to the hardware clock being incorrectly set). FIXED.<br />
funtoo_root: clean, 173796/655360 files, 436917/2621440 blocks<br />
[ ok ]<br />
* Remounting root filesystem read/write ...<br />
[ ok ]<br />
* Updating /etc/mtab ...<br />
[ ok ]<br />
* Mounting local filesystems ...<br />
[ ok ]<br />
* Configuring kernel parameters ...<br />
[ ok ]<br />
* Creating user login records ...<br />
[ ok ]<br />
* Cleaning /var/run ...<br />
[ ok ]<br />
* Wiping /tmp directory ...<br />
[ ok ]<br />
* Setting hostname to localhost ...<br />
[ ok ]<br />
* Activating swap devices ...<br />
[ ok ]<br />
* udev: storing persistent rules ...<br />
[ ok ]<br />
* Initializing random number generator ...<br />
[ ok ]<br />
INIT: Entering runlevel: 3<br />
* Mounting network filesystems ...<br />
[ ok ]<br />
* Generating dsa host key ...<br />
Generating public/private dsa key pair.<br />
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.<br />
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.<br />
The key fingerprint is:<br />
25:e0:a8:05:xxxxxxxxxxxx:1c:1f:ba root@localhost<br />
The key's randomart image is:<br />
+--[ DSA 1024]----+<br />
| ooo.B.o |<br />
| o o *.B o . |<br />
| . + + = = |<br />
| o + * |<br />
| . E S |<br />
| |<br />
| |<br />
| |<br />
| |<br />
+-----------------+<br />
[ ok ]<br />
* Generating rsa host key ...<br />
Generating public/private rsa key pair.<br />
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.<br />
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.<br />
The key fingerprint is:<br />
22:e3:46:28:67:xxxxxxxxxxxxxxxxxxxxx:e5:c3 root@localhost<br />
The key's randomart image is:<br />
+--[ RSA 2048]----+<br />
|. o. .. |<br />
|oo o ..o |<br />
|=oo o E |<br />
|.*oo. . |<br />
|o *.+ . S |<br />
| + o o . |<br />
| o |<br />
| . |<br />
| |<br />
+-----------------+<br />
[ ok ]<br />
* Starting sshd ...<br />
[ ok ]<br />
* Starting local<br />
[ ok ]<br />
<br />
<br />
Larry loves Funtoo<br />
_________________________<br />
< Have you mooed today? ><br />
-------------------------<br />
^__^<br />
(oo)_______<br />
(__) )/<br />
||----w |<br />
|| ||<br />
.::::::::::::::::::::: WELCOME TO ::::::::::::::::::::::::::..<br />
...............................................................<br />
:########:'##::::'##:'##::: ##:'########::'#######:::'#######::.<br />
:##.....:: ##:::: ##: ###:: ##:... ##..::'##.... ##:'##.... ##::<br />
:##::::::: ##:::: ##: ####: ##:::: ##:::: ##:::: ##: ##:::: ##::<br />
:######::: ##:::: ##: ## ## ##:::: ##:::: ##:::: ##: ##:::: ##::<br />
:##...:::: ##:::: ##: ##. ####:::: ##:::: ##:::: ##: ##:::: ##::<br />
:##::::::: ##:::: ##: ##:. ###:::: ##:::: ##:::: ##: ##:::: ##::<br />
:##:::::::. #######:: ##::. ##:::: ##::::. #######::. #######::′<br />
.::::::::::.......:::..::::..:::::..::::::.......::::.......::´<br />
This is localhost.unknown_domain (Linux x86_64 2.6.38-xen-maiwald.tk-domU) 17:27:40<br />
<br />
localhost login: <br />
</pre><br />
<br />
=== Finalizing the setup ===<br />
Now we test if we can reach the DomU from our Desktop:<br />
<console><br />
(2034)-~% ssh -lroot 217.x.x.211 <br />
The authenticity of host '217.x.x.211 (217.x.x.211)' can't be established.<br />
RSA key fingerprint is 22:e3:xxxxxxxx:b0:3c:xxxxx:d6:e5:c3.<br />
Are you sure you want to continue connecting (yes/no)? yes<br />
Warning: Permanently added '217.x.x.211' (RSA) to the list of known hosts.<br />
Enter passphrase for key '/home/mm/.ssh/id_rsa': <br />
localhost ~ # uname -a<br />
Linux localhost 2.6.38-xen-maiwald.tk-domU #4 SMP Wed Feb 8 17:30:33 CET 2012 x86_64 Intel(R) Xeon(R) CPU E3110 @ 3.00GHz GenuineIntel GNU/Linux<br />
localhost ~ # <br />
</console><br />
<br />
Now switch back to the Funtoo [[Installation (Tutorial)|Installation Tutorial]] and go on with setting up your new domU guest like a normal funtoo linux system!<br />
<br />
'''Please consider supporting this Wiki by editing this page and keeping it current!'''<br />
<br />
Funtoo is a perfect Xen Host and I recommend it to everybody as an alternative to .deb/.rpm Systems.<br />
<br />
Have fun!<br />
[[Category:Virtualization]]</div>Hencbhttps://www.funtoo.org/index.php?title=Portage_Git_Mirror&diff=18693Portage Git Mirror2017-04-09T10:46:13Z<p>Hencb: /* Cloning from the local git mirror */</p>
<hr />
<div>=Setting up local git mirror =<br />
<br />
This tutorial explains how to save bandwidth when several local computers need to pull updates from a single remote git repository.<br />
<br />
== Use case ==<br />
<br />
The more local funtoo instances you are maintaining, the more useful this will be to you. This -- along with a local [[Portage_Distfiles_Mirror]] -- can make maintaining multiple funtoo instances much faster, much more bandwidth efficient, and much less burdensome to upstream resources.<br />
<br />
===Terminology used herein===<br />
<br />
Following terms should be adapted<br />
<br />
{{TableStart}}<br />
<tr class="header"><br />
<th align="left">Terms</th><br />
<th align="left">Definition</th><br />
</tr><br />
<tr class="odd"><br />
<td align="left">git.lan</td><br />
<td align="left">The git-daemon local mirror host</td><br />
</tr><br />
<tr class="even"><br />
<td align="left">localhost</td><br />
<td align="left">Any local host</td><br />
</tr><br />
<tr class="odd"><br />
<td align="left">nobody</td><br />
<td align="left">Owner user of .git files</td><br />
</tr><br />
<tr class="even"><br />
<td align="left">/home/git-mirrors</td><br />
<td align="left">Base path of git-daemon</td><br />
</tr><br />
{{TableEnd}}<br />
<br />
== Local mirror ==<br />
<br />
=== Prepare directories and get portage tree ===<br />
{{console|body=<br />
###i## mkdir /home/git-mirrors<br />
###i## chown nobody /home/git-mirrors<br />
###i## su -s /bin/sh nobody<br />
$##bl## cd /home/git-mirrors<br />
$##bl## git clone --mirror --bare git://github.com/funtoo/ports-2012.git portage.git<br />
}}<br />
For security purposes we will use the {{c|nobody}} user .<br />
<br />
=== git-daemon configuration ===<br />
{{file|name=/etc/conf.d/git-daemon|desc=|body=<br />
GITDAEMON_OPTS="--syslog --verbose --enable=receive-pack --export-all"<br />
GITDAEMON_OPTS="${GITDAEMON_OPTS} --base-path=/home/git-mirrors /home/git-mirrors --interpolated-path=/home/git-mirrors"<br />
GIT_USER=nobody<br />
GIT_GROUP=nobody<br />
}}<br />
<br />
=== Service configuration ===<br />
To start daemon with a mirror machine boot add {{c|git-daemon}} to default runlevel<br />
{{console|body=<br />
###i## rc-update add git-daemon default<br />
}}<br />
To make changes start immediately just run <code>rc</code><br />
{{console|body=<br />
###i## rc<br />
}}<br />
<br />
=== Pull from remote ===<br />
<br />
If desired, the local mirror can be updated periodically using {{c|cron}}. This example updates daily:<br />
<br />
{{file|name=/etc/cron.daily/funtoo-sync.sh|desc=|body=<br />
#!/bin/sh<br />
cd /home/git-mirrors/portage.git<br />
su nobody -s "/bin/sh" -c "git fetch"<br />
}}<br />
<br />
Then make the file executable:<br />
{{console|body=<br />
###i## chmod +x /etc/cron.daily/funtoo-sync.sh<br />
}}<br />
<br />
You can also update the local mirror using {{c|emerge --sync}} or {{c|eix-sync}} if you have {{c|app-portage/eix}} installed.<br />
<br />
= Cloning from the local git mirror =<br />
<br />
In order to get a funtoo instance to sync with the local git mirror, the instance's portage directory will need some work.<br />
<br />
The following is used with any funtoo instance you wish to use your local git mirror for its tree. This will change the git remote origin to point to your local {{c|git.lan}} origin, and then start using it. (This is an updated method which obviates the need to create a {{c|/usr/portage.old}} copy of the existing {{C|/usr/portage}} directory.)<br />
<br />
Local clone from {{c|git.lan}}:<br />
{{console|body=<br />
###i## cd /usr/portage<br />
###i## git clone --depth 1 git://git.lan/portage.git tmp<br />
###i## rm -r .git<br />
###i## mv tmp/.git .<br />
###i## git reset --hard<br />
###i## chown -R portage:portage /usr/portage<br />
###i## eix-sync<br />
}}<br />
<br />
{{note|Use {{c|emerge --sync}} if you do not have {{c|app-portage/eix}} installed.}}<br />
<br />
A less reliable method is to leverage git's ability to switch between remote repositories. <br />
It can lead to conflicts and is generally more difficult to deal with if you're unfamiliar with git.<br />
<br />
{{note|github.com/funtoo/ports-2012 uses funtoo.org as its main branch. github.com/funtoo/ports-2017 uses master.<br />
Substitute --track funtoo.org with --track master in the below command for the ports-2017 portage tree.<br />
}}<br />
<br />
Local clone from {{c|git.lan}}:<br />
{{console|body=<br />
###i## cd /usr/portage<br />
###i## git remote show origin<br />
###i## git remote rm origin<br />
###i## git remote add --track funtoo.org origin git://git.lan/portage.git<br />
###i## git remote show origin<br />
###i## git branch --set-upstream-to=origin/master master<br />
###i## emerge --sync<br />
}}<br />
[[Category:HOWTO]]</div>Hencbhttps://www.funtoo.org/index.php?title=Portage_Git_Mirror&diff=18692Portage Git Mirror2017-04-04T00:39:56Z<p>Hencb: Separete more error prone git method. /* Cloning from the local git mirror */</p>
<hr />
<div>=Setting up local git mirror =<br />
<br />
This tutorial explains how to save bandwidth when several local computers need to pull updates from a single remote git repository.<br />
<br />
== Use case ==<br />
<br />
The more local funtoo instances you are maintaining, the more useful this will be to you. This -- along with a local [[Portage_Distfiles_Mirror]] -- can make maintaining multiple funtoo instances much faster, much more bandwidth efficient, and much less burdensome to upstream resources.<br />
<br />
===Terminology used herein===<br />
<br />
Following terms should be adapted<br />
<br />
{{TableStart}}<br />
<tr class="header"><br />
<th align="left">Terms</th><br />
<th align="left">Definition</th><br />
</tr><br />
<tr class="odd"><br />
<td align="left">git.lan</td><br />
<td align="left">The git-daemon local mirror host</td><br />
</tr><br />
<tr class="even"><br />
<td align="left">localhost</td><br />
<td align="left">Any local host</td><br />
</tr><br />
<tr class="odd"><br />
<td align="left">nobody</td><br />
<td align="left">Owner user of .git files</td><br />
</tr><br />
<tr class="even"><br />
<td align="left">/home/git-mirrors</td><br />
<td align="left">Base path of git-daemon</td><br />
</tr><br />
{{TableEnd}}<br />
<br />
== Local mirror ==<br />
<br />
=== Prepare directories and get portage tree ===<br />
{{console|body=<br />
###i## mkdir /home/git-mirrors<br />
###i## chown nobody /home/git-mirrors<br />
###i## su -s /bin/sh nobody<br />
$##bl## cd /home/git-mirrors<br />
$##bl## git clone --mirror --bare git://github.com/funtoo/ports-2012.git portage.git<br />
}}<br />
For security purposes we will use the {{c|nobody}} user .<br />
<br />
=== git-daemon configuration ===<br />
{{file|name=/etc/conf.d/git-daemon|desc=|body=<br />
GITDAEMON_OPTS="--syslog --verbose --enable=receive-pack --export-all"<br />
GITDAEMON_OPTS="${GITDAEMON_OPTS} --base-path=/home/git-mirrors /home/git-mirrors --interpolated-path=/home/git-mirrors"<br />
GIT_USER=nobody<br />
GIT_GROUP=nobody<br />
}}<br />
<br />
=== Service configuration ===<br />
To start daemon with a mirror machine boot add {{c|git-daemon}} to default runlevel<br />
{{console|body=<br />
###i## rc-update add git-daemon default<br />
}}<br />
To make changes start immediately just run <code>rc</code><br />
{{console|body=<br />
###i## rc<br />
}}<br />
<br />
=== Pull from remote ===<br />
<br />
If desired, the local mirror can be updated periodically using {{c|cron}}. This example updates daily:<br />
<br />
{{file|name=/etc/cron.daily/funtoo-sync.sh|desc=|body=<br />
#!/bin/sh<br />
cd /home/git-mirrors/portage.git<br />
su nobody -s "/bin/sh" -c "git fetch"<br />
}}<br />
<br />
Then make the file executable:<br />
{{console|body=<br />
###i## chmod +x /etc/cron.daily/funtoo-sync.sh<br />
}}<br />
<br />
You can also update the local mirror using {{c|emerge --sync}} or {{c|eix-sync}} if you have {{c|app-portage/eix}} installed.<br />
<br />
= Cloning from the local git mirror =<br />
<br />
In order to get a funtoo instance to sync with the local git mirror, the instance's portage directory will need some work.<br />
<br />
The following is used with any funtoo instance you wish to use your local git mirror for its tree. This will change the git remote origin to point to your local {{c|git.lan}} origin, and then start using it. (This is an updated method which obviates the need to create a {{c|/usr/portage.old}} copy of the existing {{C|/usr/portage}} directory.)<br />
<br />
Local clone from {{c|git.lan}}:<br />
{{console|body=<br />
###i## cd /usr/portage<br />
###i## git clone --depth 1 git://git.lan/portage.git tmp<br />
###i## rm -r .git<br />
###i## mv tmp/.git .<br />
###i## git reset --hard<br />
###i## chown -R portage:portage /usr/portage<br />
###i## eix-sync<br />
}}<br />
<br />
{{note|Use {{c|emerge --sync}} if you do not have {{c|app-portage/eix}} installed.}}<br />
<br />
A less reliable method is to leverage git's ability to switch between remote repositories. <br />
It can lead to conflicts and is generally more difficult to deal with if you're unfamiliar with git.<br />
<br />
{{note|github.com/funtoo/ports-2012 uses funtoo.org as its main branch. github.com/funtoo/ports-2017 uses master.<br />
Substitute --track funtoo.org with --track master in the below command for the ports-2017 portage tree.<br />
}}<br />
<br />
Local clone from {{c|git.lan}}:<br />
{{console|body=<br />
###i## cd /usr/portage<br />
###i## git remote show origin<br />
###i## git remote rm origin<br />
###i## git remote add --track funtoo.org origin git://git.lan/portage.git<br />
###i## git remote show origin<br />
###i## emerge --sync<br />
}}<br />
[[Category:HOWTO]]</div>Hencbhttps://www.funtoo.org/index.php?title=Package:Tigervnc&diff=18577Package:Tigervnc2017-03-12T02:05:45Z<p>Hencb: </p>
<hr />
<div>{{Ebuild<br />
|Summary=TigerVNC is a high-performance, platform-neutral implementation of VNC (Virtual Network Computing), a client/server application that allows users to launch and interact with graphical applications on remote machines. TigerVNC provides the levels of performance necessary to run 3D and video applications, and it attempts to maintain a common look and feel and re-use components, where possible, across the various platforms that it supports.<br />
|CatPkg=net-misc/tigervnc<br />
|Homepage=http://tigervnc.org/<br />
}}<br />
TigerVNC is a powerful tool to manage remote machines through a graphical interface using the standard VNC protocol. <br />
<br />
===Installation===<br />
If you only intend to connect using the TigerVNC client, just emerging the packet should be sufficient:<br />
{{console|body=###i## emerge net-misc/tigervnc}}<br />
However if you intend to run TigerVNC on a server, the server use flag should be set. Adding it to package.use is a good idea:<br />
{{file|name=/etc/portage/package.use|desc=|body=<br />
net-misc/tigervnc server<br />
}}<br />
After setting the server use flag, and emerge the package:<br />
{{console|body=###i## emerge net-misc/tigervnc}}<br />
<br />
{{warning|Listening on any IP address is insecure, and VNC passwords can be brute-forced. It is much safer to use SSH-tunnelling to connect to a VNC session, and this wiki page will proceed to describe a SSH-tunnelling setup.}}<br />
<br />
By default, tigervnc listens on any IP address and uses simple password-based authentication. A common and safe approach to address the safety concerns is to use a ssh tunnel and allow TigerVNC only to connect to client requests that originate from the server itself. To listen only on localhost add the -localhost option to the start function of the init script :<br />
{{file|name=/etc/init.d/tigervnc|desc=|body=<br />
fi<br />
<br />
su ${shell} ${user%%:*} -c "source /etc/profile && cd ~${user%%:*} && vncserver :${user##*:} $vnc_opts -localhost" &>/dev/null<br />
done<br />
eend $?<br />
}<br />
}}<br />
<br />
===Client Configuration===<br />
<br />
Probably the safest way to connect to a remote VNC server with the tigervnc client is to create an appropriate<br />
ssh tunnel: <br />
{{console|body=###i## ssh -L 5901:127.0.0.1:5901 -N -f -l user www.example.com}}<br />
<br />
SSH will listen on port 5901 of your local machine and forward/receive any data from the remote server as if it was originating from your machine. The same is true for the server: it thinks that the VNC client connecting to it is running on the server and listening on port 5901, while the connection is really coming from a remote host. The commands are exactly the same as a setup that runs a VNC client and server on a local machine.<br />
<br />
Check that ssh is running and listening on the right port:<br />
{{console|body=###i## netstat -tlpn}}<br />
You should find a line that looks something like the one below:<br />
{{console|body=tcp 0 0 127.0.0.1:5901 0.0.0.0:* LISTEN 13309/ssh<br />
tcp6 0 0 ::1:5902 :::* LISTEN 13309/ssh}}<br />
<br />
Now, run TigerVNC and type in the address and port you're listening to. In this case, we're listening<br />
on our local machine (127.0.0.1) and port :5901, so the line entered in the TigerVNC dialog should be:<br />
{{console| body=127.0.0.1:5901 }}<br />
<br />
When you click on Connect, you should be prompted for a password. Enter the password you set on the server side and you should be good to go. <br />
<br />
Alternatively, you can launch TigerVNC through the command line:<br />
<br />
{{console|body=$ ##i## vncviewer 127.0.0.1:5901}}<br />
<br />
===Server Configuration===<br />
We'll assume you're running TigerVNC locally and connecting through an SSH tunnel. This is a safer way to run VNC comparable to other options, and also the easiest to setup.<br />
<br />
After the initial install, you will need to configure for which users VNC should be available. This is done by editing /etc/conf.d/tigervnc: <br />
{{file|name=/etc/conf.d/tigervnc|desc=|body=<br />
DISPLAYS="funtoo:1"<br />
}}<br />
This will tell TigerVNC to start a VNC session for user "funtoo" on the first display, and on port 5900 + displaynumber (in this case, 5900 + 1). <br />
<br />
Then, as "funtoo", you need to create the VNC password that will be used to access a VNC session:<br />
<br />
{{console|body=$ ##i## vncpasswd}}<br />
<br />
This will create a password file in ~/.vnc/passwd. <br />
You also have to create a xstartup file to tell VNC which desktop environment to run. Make sure that you installed the Desktop Environment in question before running VNC. A minimal configuration is displayed below, though more elaborate ones are more common:<br />
<br />
{{file|name=~/.vnc/xstartup|desc=|body=<br />
#!/bin/sh<br />
/usr/bin/gnome-session & #start a GNOME3 VNC session<br />
#/usr/bin/lxsession -s LXDE & <br />
#exec /usr/bin/plasmashell & #start a kde-plasma-5 VNC session<br />
}}<br />
Make sure that xstartup is executable:<br />
<br />
{{console|body=###i## chmod +x ~/.vnc/xstartup}}<br />
<br />
now, start the tigervnc server:<br />
<br />
{{console|body=###i## service tigervnc start}}<br />
<br />
If you're encountering errors, check ~/.vnc/user-main:1.log for errors. <br />
Test that you can connect to the VNC server and if you're successful add tigervnc to the default runlevel:<br />
<br />
{{console|body=###i## rc-update add tigervnc default}}<br />
<br />
===Conclusion===<br />
This should be enough to get you started with TigerVNC. Happy hacking!<br />
{{EbuildFooter}}</div>Hencbhttps://www.funtoo.org/index.php?title=Package:Tigervnc&diff=18576Package:Tigervnc2017-03-12T02:05:18Z<p>Hencb: </p>
<hr />
<div>{{Ebuild<br />
|Summary=TigerVNC is a high-performance, platform-neutral implementation of VNC (Virtual Network Computing), a client/server application that allows users to launch and interact with graphical applications on remote machines. TigerVNC provides the levels of performance necessary to run 3D and video applications, and it attempts to maintain a common look and feel and re-use components, where possible, across the various platforms that it supports.<br />
|CatPkg=net-misc/tigervnc<br />
|Homepage=http://tigervnc.org/<br />
}}<br />
TigerVNC is a powerful tool to manage remote machines through a graphical interface using the standard VNC protocol. <br />
<br />
===Installation===<br />
If you only intend to connect using the TigerVNC client, just emerging the packet should be sufficient:<br />
{{console|body=###i## emerge net-misc/tigervnc}}<br />
However if you intend to run TigerVNC on a server, the server use flag should be set. Adding it to package.use is a good idea:<br />
{{file|name=/etc/portage/package.use|desc=|body=<br />
net-misc/tigervnc server<br />
}}<br />
After setting the server use flag, emerge the package:<br />
{{console|body=###i## emerge net-misc/tigervnc}}<br />
<br />
{{warning|Listening on any IP address is insecure, and VNC passwords can be brute-forced. It is much safer to use SSH-tunnelling to connect to a VNC session, and this wiki page will proceed to describe a SSH-tunnelling setup.}}<br />
<br />
By default, tigervnc listens on any IP address and uses simple password-based authentication. A common and safe approach to address the safety concerns is to use a ssh tunnel and allow TigerVNC only to connect to client requests that originate from the server itself. To listen only on localhost add the -localhost option to the start function of the init script :<br />
{{file|name=/etc/init.d/tigervnc|desc=|body=<br />
fi<br />
<br />
su ${shell} ${user%%:*} -c "source /etc/profile && cd ~${user%%:*} && vncserver :${user##*:} $vnc_opts -localhost" &>/dev/null<br />
done<br />
eend $?<br />
}<br />
}}<br />
<br />
===Client Configuration===<br />
<br />
Probably the safest way to connect to a remote VNC server with the tigervnc client is to create an appropriate<br />
ssh tunnel: <br />
{{console|body=###i## ssh -L 5901:127.0.0.1:5901 -N -f -l user www.example.com}}<br />
<br />
SSH will listen on port 5901 of your local machine and forward/receive any data from the remote server as if it was originating from your machine. The same is true for the server: it thinks that the VNC client connecting to it is running on the server and listening on port 5901, while the connection is really coming from a remote host. The commands are exactly the same as a setup that runs a VNC client and server on a local machine.<br />
<br />
Check that ssh is running and listening on the right port:<br />
{{console|body=###i## netstat -tlpn}}<br />
You should find a line that looks something like the one below:<br />
{{console|body=tcp 0 0 127.0.0.1:5901 0.0.0.0:* LISTEN 13309/ssh<br />
tcp6 0 0 ::1:5902 :::* LISTEN 13309/ssh}}<br />
<br />
Now, run TigerVNC and type in the address and port you're listening to. In this case, we're listening<br />
on our local machine (127.0.0.1) and port :5901, so the line entered in the TigerVNC dialog should be:<br />
{{console| body=127.0.0.1:5901 }}<br />
<br />
When you click on Connect, you should be prompted for a password. Enter the password you set on the server side and you should be good to go. <br />
<br />
Alternatively, you can launch TigerVNC through the command line:<br />
<br />
{{console|body=$ ##i## vncviewer 127.0.0.1:5901}}<br />
<br />
===Server Configuration===<br />
We'll assume you're running TigerVNC locally and connecting through an SSH tunnel. This is a safer way to run VNC comparable to other options, and also the easiest to setup.<br />
<br />
After the initial install, you will need to configure for which users VNC should be available. This is done by editing /etc/conf.d/tigervnc: <br />
{{file|name=/etc/conf.d/tigervnc|desc=|body=<br />
DISPLAYS="funtoo:1"<br />
}}<br />
This will tell TigerVNC to start a VNC session for user "funtoo" on the first display, and on port 5900 + displaynumber (in this case, 5900 + 1). <br />
<br />
Then, as "funtoo", you need to create the VNC password that will be used to access a VNC session:<br />
<br />
{{console|body=$ ##i## vncpasswd}}<br />
<br />
This will create a password file in ~/.vnc/passwd. <br />
You also have to create a xstartup file to tell VNC which desktop environment to run. Make sure that you installed the Desktop Environment in question before running VNC. A minimal configuration is displayed below, though more elaborate ones are more common:<br />
<br />
{{file|name=~/.vnc/xstartup|desc=|body=<br />
#!/bin/sh<br />
/usr/bin/gnome-session & #start a GNOME3 VNC session<br />
#/usr/bin/lxsession -s LXDE & <br />
#exec /usr/bin/plasmashell & #start a kde-plasma-5 VNC session<br />
}}<br />
Make sure that xstartup is executable:<br />
<br />
{{console|body=###i## chmod +x ~/.vnc/xstartup}}<br />
<br />
now, start the tigervnc server:<br />
<br />
{{console|body=###i## service tigervnc start}}<br />
<br />
If you're encountering errors, check ~/.vnc/user-main:1.log for errors. <br />
Test that you can connect to the VNC server and if you're successful add tigervnc to the default runlevel:<br />
<br />
{{console|body=###i## rc-update add tigervnc default}}<br />
<br />
===Conclusion===<br />
This should be enough to get you started with TigerVNC. Happy hacking!<br />
{{EbuildFooter}}</div>Hencbhttps://www.funtoo.org/index.php?title=Package:Tigervnc&diff=18482Package:Tigervnc2017-02-18T21:56:32Z<p>Hencb: </p>
<hr />
<div>{{Ebuild<br />
|Summary=TigerVNC is a high-performance, platform-neutral implementation of VNC (Virtual Network Computing), a client/server application that allows users to launch and interact with graphical applications on remote machines. TigerVNC provides the levels of performance necessary to run 3D and video applications, and it attempts to maintain a common look and feel and re-use components, where possible, across the various platforms that it supports.<br />
|CatPkg=net-misc/tigervnc<br />
|Homepage=http://tigervnc.org/<br />
}}<br />
TigerVNC is a powerful tool to manage remote machines through a graphical interface using the standard VNC protocol. <br />
<br />
===Installation===<br />
If you only intend to connect using the TigerVNC client, just emerging the packet should be sufficient:<br />
{{console|body=###i## emerge net-misc/tigervnc}}<br />
However if you intend to run TigerVNC on a server, the server use flag should be set. Adding it to package.use is a good idea:<br />
{{file|name=/etc/portage/package.use|desc=|body=<br />
net-misc/tigervnc server<br />
}}<br />
After setting the server use flag, emerge the package:<br />
{{console|body=###i## emerge net-misc/tigervnc}}<br />
<br />
{{warning|The tigervnc ebuild requires a certain version on xorg-server to be present on the system when the server use flag is enabled. If your current version of xorg-server is older than the xorg version listed in the ebuild, you might want to try installing an older version of tigervnc. If you're running a newer version of xorg-server than the one listed in the ebuild, try running a newer version. If even the latest version uses an outdated version of xorg-server, please create a bug report on our bugtracker so that we can update tigervnc to use the new version.}}<br />
<br />
===Client Configuration===<br />
<br />
The simplest way to connect to a remote VNC server with the tigervnc client is to create an appropriate<br />
ssh tunnel: <br />
{{console|body=###i## ssh -L 5902:127.0.0.1:5902 -N -f -l user www.example.com}}<br />
<br />
SSH will listen on port 5902 of your local machine and forward/receive any data from the remote server as if it was originating from your machine. The same is true for the server: it thinks that the VNC client connecting to it is running on the server and listening on port 5901. The commands are exactly the same as a setup that runs a VNC client and server on a local machine.<br />
<br />
Check that ssh is running and listening on the right port:<br />
{{console|body=###i## netstat -tlpn}}<br />
You should find a line that looks something like the one below:<br />
{{console|body=tcp 0 0 127.0.0.1:5902 0.0.0.0:* LISTEN 13309/ssh<br />
tcp6 0 0 ::1:5902 :::* LISTEN 13309/ssh}}<br />
<br />
Now, run TigerVNC and type in the address and port you're listening to. In this case, we're listening<br />
on our local machine (127.0.0.1) and port :5902, so the line entered in the TigerVNC dialog should be:<br />
{{console| body=127.0.0.1:5902 }}<br />
<br />
When you click on Connect, you should be prompted for a password. Enter the password you set on the server side and you should be good to go. <br />
<br />
Alternatively, you can launch TigerVNC through the command line:<br />
<br />
{{console|body=$ ##i## vncviewer 127.0.0.1:5901}}<br />
<br />
===Server Configuration===<br />
We'll assume you're running TigerVNC locally and connecting through an SSH tunnel. This is a safer way to run VNC comparable to other options, and also the easiest to setup.<br />
<br />
After the initial install, you will need to configure for which users VNC should be available. This is done by editing /etc/conf.d/tigervnc: <br />
{{file|name=/etc/conf.d/tigervnc|desc=|body=<br />
DISPLAYS="funtoo:1"<br />
}}<br />
This will tell TigerVNC to start a VNC session for user "funtoo" on the first display, and on port 5900 + displaynumber (in this case, 5900 + 1). <br />
<br />
Then, as "funtoo", you need to create the VNC password that will be used to access a VNC session:<br />
<br />
{{console|body=$ ##i## vncpasswd}}<br />
<br />
This will create a password file in ~/.vnc/passwd. <br />
You also have to create a xstartup file to tell VNC which desktop environment to run. Make sure that you installed the Desktop Environment in question before running VNC. A minimal configuration is displayed below, though more elaborate ones are more common:<br />
<br />
{{file|name=~/.vnc/xstartup|desc=|body=<br />
#!/bin/sh<br />
/usr/bin/gnome-session &<br />
#/usr/bin/lxsession -s LXDE &<br />
}}<br />
Make sure that xstartup is executable:<br />
<br />
{{console|body=###i## chmod +x ~/.vnc/xstartup}}<br />
<br />
now, start the tigervnc server:<br />
<br />
{{console|body=###i## service tigervnc start}}<br />
<br />
If you're encountering errors, check ~/.vnc/user-main:1.log for errors. <br />
Test that you can connect to the VNC server and if you're successful add tigervnc to the default runlevel:<br />
<br />
{{console|body=###i## rc-update add tigervnc default}}<br />
<br />
===Conclusion===<br />
This should be enough to get you started with TigerVNC. Happy hacking!<br />
{{EbuildFooter}}</div>Hencbhttps://www.funtoo.org/index.php?title=Package:Tigervnc&diff=18481Package:Tigervnc2017-02-18T21:48:53Z<p>Hencb: Added minimal TigerVNC usage guidelines</p>
<hr />
<div>{{Ebuild<br />
|Summary=TigerVNC is a high-performance, platform-neutral implementation of VNC (Virtual Network Computing), a client/server application that allows users to launch and interact with graphical applications on remote machines. TigerVNC provides the levels of performance necessary to run 3D and video applications, and it attempts to maintain a common look and feel and re-use components, where possible, across the various platforms that it supports.<br />
|CatPkg=net-misc/tigervnc<br />
|Homepage=http://tigervnc.org/<br />
}}<br />
TigerVNC is a powerful tool to manage remote machines through a graphical interface using the standard VNC protocol. <br />
<br />
===Installation===<br />
If you only intend to connect using the TigerVNC client, just emerging the packet should be sufficient:<br />
{{console|body=###i## emerge net-misc/tigervnc}}<br />
However if you intend to run TigerVNC on a server, the server use flag should be set. Adding it to package.use is a good idea:<br />
{{file|name=/etc/portage/package.use|desc=|body=<br />
net-misc/tigervnc server<br />
}}<br />
After setting the server use flag, emerge the package:<br />
{{console|body=###i## emerge net-misc/tigervnc}}<br />
<br />
{{warning|The tigervnc ebuild requires a certain version on xorg-server to be present on the system when the server use flag is enabled. If your current version of xorg-server is older than the xorg version listed in the ebuild, you might want to try installing an older version of tigervnc. If you're running a newer version of xorg-server than the one listed in the ebuild, try running a newer version. If even the latest version uses an outdated version of xorg-server, please create a bug report on our bugtracker so that we can update tigervnc to use the new version.}}<br />
<br />
===Client Configuration===<br />
<br />
The simplest way to connect to a remote VNC server with the tigervnc client is to create an appropriate<br />
ssh tunnel: <br />
{{console|body=###i## ssh -L 5902:127.0.0.1:5902 -N -f -l user www.example.com}}<br />
<br />
SSH will listen on port 5902 of your local machine and forward/receive any data from the remote server as if it was originating from your machine. The same is true for the server: it thinks that the VNC client connecting to it is running on the server and listening on port 5901. The commands are exactly the same as a setup that runs a VNC client and server on a local machine.<br />
<br />
Check that ssh is running and listening on the right port:<br />
{{console|body=###i## netstat -tlpn}}<br />
You should find a line that looks something like the one below:<br />
{{console|body=tcp 0 0 127.0.0.1:5902 0.0.0.0:* LISTEN 13309/ssh<br />
tcp6 0 0 ::1:5902 :::* LISTEN 13309/ssh}}<br />
<br />
Now, run TigerVNC and type in the address and port you're listening to. In this case, we're listening<br />
on our local machine (127.0.0.1) and port :5902, so the line entered in the TigerVNC dialog should be:<br />
{{console| body=127.0.0.1:5902 }}<br />
<br />
When you click on Connect, you should be prompted for a password. Enter the password you set on the server side and you should be good to go. <br />
<br />
Alternatively, you can launch TigerVNC through the command line:<br />
<br />
{{console|body=###i#$ vncviewer 127.0.0.1:5901}}<br />
<br />
===Server Configuration===<br />
We'll assume you're running TigerVNC locally and connecting through an SSH tunnel. This is a safer way to run VNC comparable to other options, and also the easiest to setup.<br />
<br />
After the initial install, you will need to configure for which users VNC should be available. This is done by editing /etc/conf.d/tigervnc: <br />
{{file|name=/etc/conf.d/tigervnc|desc=|body=<br />
DISPLAYS="funtoo:1"<br />
}}<br />
This will tell TigerVNC to start a VNC session for user "funtoo" on the first display, and on port 5900 + displaynumber (in this case, 5900 + 1). <br />
<br />
Then, as "funtoo", you need to create the VNC password that will be used to access a VNC session:<br />
<br />
{{console|body=$ ##i## vncpasswd}}<br />
<br />
This will create a password file in ~/.vnc/passwd. <br />
You also have to create a xstartup file to tell VNC which desktop environment to run. Make sure that you installed the Desktop Environment in question before running VNC. A minimal configuration is displayed below, though more elaborate ones are more common:<br />
<br />
{{file|name=~/.vnc/xstartup|desc=|body=<br />
#!/bin/sh<br />
/usr/bin/gnome-session &<br />
#/usr/bin/lxsession -s LXDE &<br />
}}<br />
Make sure that xstartup is executable:<br />
<br />
{{console|body=###i## chmod +x ~/.vnc/xstartup}}<br />
<br />
now, start the tigervnc server:<br />
<br />
{{console|body=###i## service tigervnc start}}<br />
<br />
If you're encountering errors, check ~/.vnc/user-main:1.log for errors. <br />
Test that you can connect to the VNC server and if you're successful add tigervnc to the default runlevel:<br />
<br />
{{console|body=###i## rc-update add tigervnc default}}<br />
<br />
===Conclusion===<br />
This should be enough to get you started with TigerVNC. Happy hacking!<br />
{{EbuildFooter}}</div>Hencbhttps://www.funtoo.org/index.php?title=Steam&diff=17814Steam2017-01-21T12:00:36Z<p>Hencb: /* Missing textures (Screen in Dota 2 and other Source games is all red/black!) */</p>
<hr />
<div>{{PageNeedsUpdates}}<br />
<br />
Steam is a content delivery system available for GNU/Linux gaming.<br />
<br />
=== Install ===<br />
In order to install Steam, we must first install {{package|app-portage/layman}}.<br />
<br />
Once layman is installed and synced, we must add the {{c|gamerlay}} repository:<br />
<br />
{{console|body=<br />
###i## layman -a gamerlay<br />
###i## layman -S<br />
}}<br />
<br />
Ok, now we can install steam by running:<br />
<br />
{{console|body=<br />
###i## emerge steam-launcher<br />
}}<br />
<br />
== install part 2 ==<br />
Make sure your user is in the 'games' group by typing:<br />
<console>###i## groups youruser</console><br />
<br />
If not add your user to the 'games' group by typing:<br />
<console>###i## usermod -a -G games youruser</console><br />
<br />
Your groups will not update until you log out and log back in again. You can check this by just entering in a terminal<br />
<console>###i## groups</console><br />
and if you just added yourself to the group games it will not appear there. However, if you would type "groups ouruser" like before, then you could see that you already added yourself to that group. Steam will not start properly until you have logged in as a member of the games group.<br />
<br />
Steam has its own internal package management system. Portage will not track its files, or games installed. the ebuild simply pulls in the steam installer, to run the steam installer:<br />
<br />
<console>$##i## /usr/games/bin/steam</console><br />
<br />
The installer will prompt you with several questions, once done running the installer command will load the latest version of steam.<br />
<br />
This will also create a desktop entry under ~/Desktop/steam.desktop<br />
<br />
== Troubleshooting ==<br />
=== Text is corrupt or missing ===<br />
Steam makes heavy usage of the Arial font. A decent Arial font to use is ttf-liberation.<br />
<console><br />
# ##i##emerge liberation-fonts<br />
# ##i##eselect fontconfig enable 60-liberation.conf<br />
</console><br />
<br />
=== Steam segfaults after 2nd start! ===<br />
I do not know much about this behaviour, but I found a workaround.<br />
If you saved your password, you need to backup all your games and reset Steam.<br />
{{console|body=<br />
$ ##i##mkdir -p ~/backup<br />
$ ##i##mv ~/.local/share/Steam/steamapps ~/backup<br />
$ ##i##steam --reset<br />
$ ##i##mv ~/backup ~/.local/share/Steam/steamapps<br />
}}<br />
Start Steam again, enter username and password, but do not check "Remember my password", it is the thing that causes all the troubles. You will need to enter password every time you start Steam.<br />
<br />
===Missing textures (Screen in Dota 2 and other Source games is all red/black!) ===<br />
Many steam games heavily rely on S3TC compressed textures, which require the libxtc_dxtn library<br />
to be compiled with 32bit support:<br />
{{console|body=<br />
# ##i##echo 'media-libs/libtxc_dxtn abi_x86_32' >> /etc/portage/package.use<br />
# ##i##emerge media-libs/libtxc_dxtn<br />
}}<br />
<br />
=== OpenGL GLX context is not using direct rendering ===<br />
This can happen when the latest version of mesa drivers conflict with steam's bundled libstdc++ libraries[1], especially when open source video card drivers are installed.<br />
<br />
So that steam does not use its bundled libstdc++ libraries, they may be removed[2]:<br />
<console><br />
# ##i##rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/installed/libstdc++6-4.6-pic_4.6.3-1ubuntu5+srt4_amd64 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/installed/libstdc++6-4.6-pic_4.6.3-1ubuntu5+srt4_amd64.md5 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/installed/libstdc++6_4.8.1-2ubuntu1~12.04+steamrt2+srt1_amd64 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/installed/libstdc++6_4.8.1-2ubuntu1~12.04+steamrt2+srt1_amd64.md5 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++_pic.a && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++_pic.map && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/share/doc/libstdc++6 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/share/doc/libstdc++6-4.6-pic && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/installed/libstdc++6-4.6-pic_4.6.3-1ubuntu5+srt4_i386 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/installed/libstdc++6-4.6-pic_4.6.3-1ubuntu5+srt4_i386.md5 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/installed/libstdc++6_4.8.1-2ubuntu1~12.04+steamrt2+srt1_i386 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/installed/libstdc++6_4.8.1-2ubuntu1~12.04+steamrt2+srt1_i386.md5 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/gcc/i686-linux-gnu/4.6/libstdc++_pic.a && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/gcc/i686-linux-gnu/4.6/libstdc++_pic.map && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6.0.18 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/share/doc/libstdc++6 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/share/doc/libstdc++6-4.6-pic && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/share/doc/libstdc++6<br />
</console><br />
and<br />
<console><br />
# ##i##rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libgcc_s.so.1 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1<br />
</console><br />
<br />
=== Removal ===<br />
To remove steam, and content in case of corruption:<br />
{{console|body=<br />
$##i## rm -rf .local/share/Steam<br />
$##i## rm -rf .Steam<br />
}}<br />
<br />
== References ==<br />
[1]: higuita, Ev1l0rd. [http://askubuntu.com/questions/614422/problem-with-installing-steam-on-ubuntu-15-04/614458#614458 Problem with installing Steam on Ubuntu 15.04 - Ask Ubuntu], [http://askubuntu.com/ Ask Ubuntu], April 26th, 2015. Retrieved December 29th, 2015.<br />
<br />
[2]: altiris. [https://bbs.archlinux.org/viewtopic.php?id=193802 [SOLVED<nowiki>]</nowiki> Steam won't open, libGL errors], [https://bbs.archlinux.org/ Arch Linux Forums], February 18, 2015. Retrieved July 14th, 2015.</div>Hencbhttps://www.funtoo.org/index.php?title=Steam&diff=17813Steam2017-01-21T12:00:14Z<p>Hencb: /* Troubleshooting */</p>
<hr />
<div>{{PageNeedsUpdates}}<br />
<br />
Steam is a content delivery system available for GNU/Linux gaming.<br />
<br />
=== Install ===<br />
In order to install Steam, we must first install {{package|app-portage/layman}}.<br />
<br />
Once layman is installed and synced, we must add the {{c|gamerlay}} repository:<br />
<br />
{{console|body=<br />
###i## layman -a gamerlay<br />
###i## layman -S<br />
}}<br />
<br />
Ok, now we can install steam by running:<br />
<br />
{{console|body=<br />
###i## emerge steam-launcher<br />
}}<br />
<br />
== install part 2 ==<br />
Make sure your user is in the 'games' group by typing:<br />
<console>###i## groups youruser</console><br />
<br />
If not add your user to the 'games' group by typing:<br />
<console>###i## usermod -a -G games youruser</console><br />
<br />
Your groups will not update until you log out and log back in again. You can check this by just entering in a terminal<br />
<console>###i## groups</console><br />
and if you just added yourself to the group games it will not appear there. However, if you would type "groups ouruser" like before, then you could see that you already added yourself to that group. Steam will not start properly until you have logged in as a member of the games group.<br />
<br />
Steam has its own internal package management system. Portage will not track its files, or games installed. the ebuild simply pulls in the steam installer, to run the steam installer:<br />
<br />
<console>$##i## /usr/games/bin/steam</console><br />
<br />
The installer will prompt you with several questions, once done running the installer command will load the latest version of steam.<br />
<br />
This will also create a desktop entry under ~/Desktop/steam.desktop<br />
<br />
== Troubleshooting ==<br />
=== Text is corrupt or missing ===<br />
Steam makes heavy usage of the Arial font. A decent Arial font to use is ttf-liberation.<br />
<console><br />
# ##i##emerge liberation-fonts<br />
# ##i##eselect fontconfig enable 60-liberation.conf<br />
</console><br />
<br />
=== Steam segfaults after 2nd start! ===<br />
I do not know much about this behaviour, but I found a workaround.<br />
If you saved your password, you need to backup all your games and reset Steam.<br />
{{console|body=<br />
$ ##i##mkdir -p ~/backup<br />
$ ##i##mv ~/.local/share/Steam/steamapps ~/backup<br />
$ ##i##steam --reset<br />
$ ##i##mv ~/backup ~/.local/share/Steam/steamapps<br />
}}<br />
Start Steam again, enter username and password, but do not check "Remember my password", it is the thing that causes all the troubles. You will need to enter password every time you start Steam.<br />
<br />
===Missing textures (Screen in Dota 2 and other Source games is all red/black!) ===<br />
Many steam games heavily rely on S3TC compressed textures, which require the libxtc_dxtn library<br />
to be compressed with 32bit support:<br />
{{console|body=<br />
# ##i##echo 'media-libs/libtxc_dxtn abi_x86_32' >> /etc/portage/package.use<br />
# ##i##emerge media-libs/libtxc_dxtn<br />
}}<br />
<br />
=== OpenGL GLX context is not using direct rendering ===<br />
This can happen when the latest version of mesa drivers conflict with steam's bundled libstdc++ libraries[1], especially when open source video card drivers are installed.<br />
<br />
So that steam does not use its bundled libstdc++ libraries, they may be removed[2]:<br />
<console><br />
# ##i##rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/installed/libstdc++6-4.6-pic_4.6.3-1ubuntu5+srt4_amd64 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/installed/libstdc++6-4.6-pic_4.6.3-1ubuntu5+srt4_amd64.md5 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/installed/libstdc++6_4.8.1-2ubuntu1~12.04+steamrt2+srt1_amd64 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/installed/libstdc++6_4.8.1-2ubuntu1~12.04+steamrt2+srt1_amd64.md5 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++_pic.a && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++_pic.map && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/share/doc/libstdc++6 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/share/doc/libstdc++6-4.6-pic && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/installed/libstdc++6-4.6-pic_4.6.3-1ubuntu5+srt4_i386 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/installed/libstdc++6-4.6-pic_4.6.3-1ubuntu5+srt4_i386.md5 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/installed/libstdc++6_4.8.1-2ubuntu1~12.04+steamrt2+srt1_i386 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/installed/libstdc++6_4.8.1-2ubuntu1~12.04+steamrt2+srt1_i386.md5 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/gcc/i686-linux-gnu/4.6/libstdc++_pic.a && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/gcc/i686-linux-gnu/4.6/libstdc++_pic.map && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6.0.18 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/share/doc/libstdc++6 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/share/doc/libstdc++6-4.6-pic && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/share/doc/libstdc++6<br />
</console><br />
and<br />
<console><br />
# ##i##rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libgcc_s.so.1 && rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1<br />
</console><br />
<br />
=== Removal ===<br />
To remove steam, and content in case of corruption:<br />
{{console|body=<br />
$##i## rm -rf .local/share/Steam<br />
$##i## rm -rf .Steam<br />
}}<br />
<br />
== References ==<br />
[1]: higuita, Ev1l0rd. [http://askubuntu.com/questions/614422/problem-with-installing-steam-on-ubuntu-15-04/614458#614458 Problem with installing Steam on Ubuntu 15.04 - Ask Ubuntu], [http://askubuntu.com/ Ask Ubuntu], April 26th, 2015. Retrieved December 29th, 2015.<br />
<br />
[2]: altiris. [https://bbs.archlinux.org/viewtopic.php?id=193802 [SOLVED<nowiki>]</nowiki> Steam won't open, libGL errors], [https://bbs.archlinux.org/ Arch Linux Forums], February 18, 2015. Retrieved July 14th, 2015.</div>Hencb