{"id":25,"date":"2007-09-26T22:54:12","date_gmt":"2007-09-27T05:54:12","guid":{"rendered":"http:\/\/www.kernelcrash.com\/blog\/2007\/09\/26\/installing-chrooted-debian-etch-under-slackware-120\/"},"modified":"2007-09-27T03:37:17","modified_gmt":"2007-09-27T10:37:17","slug":"installing-chrooted-debian-etch-under-slackware-120","status":"publish","type":"post","link":"https:\/\/www.kernelcrash.com\/blog\/installing-chrooted-debian-etch-under-slackware-120\/2007\/09\/26\/","title":{"rendered":"Installing chrooted debian etch under slackware 12.0"},"content":{"rendered":"<p>OK, so now that I&#8217;ve installed slackware 12.0 on this TP600X I was thinking about how I might get on if I converted my T42 back to slackware. Surely there&#8217;d be a heap of packages I&#8217;d miss. Sure I could compile from source. I used to do that years ago when I ran Slackware on a few systems. The problem became that open source writers seemed hell bent on adding as many convoluted dependencies into their packages &#8230; that you could easily waste a weekend just trying to get some program to compile. Not fun.<\/p>\n<p>Then I thought, why not install debian in a chroot and run the more difficult packages from the chroot.<\/p>\n<p>There&#8217;s a few notes on the net about using debootstrap to install debian in a chroot, but here&#8217;s what I did:<\/p>\n<pre>\r\nGet the debootstrap deb from http:\/\/packages.debian.org\/etch\/debootstrap\/all\/download.\r\nDon't be like me and get the tar.gz from debian. That didn't work for me even though\r\ndebootstrap is just a shell script\r\n\r\n  cd \/tmp\r\n  ar x debootstrap_0.3.3.2etch1_all.deb\r\n\r\nExtract it in your host system\r\n\r\n   cd \/\r\n   tar xvzf \/tmp\/data.tar.gz\r\n\r\nRun:\r\n\r\n   debootstrapdebootstrap --arch i386 etch \/chroot http:\/\/ftp.debian.org\/debian\/\r\n\r\n   echo \"proc \/chroot\/proc proc none 0 0\" &gt;&gt; \/etc\/fstab\r\n\r\n   mount \/chroot\/proc\r\n\r\n   mount --bind \/dev \/chroot\/dev\r\n\r\n   cp \/etc\/hosts \/chroot\/etc\r\n\r\n   chroot \/chroot \/bin\/bash\r\n\r\n   chroot# &gt; apt-get update\r\n\r\n   chroot#&gt; apt-get install locales\r\n\r\n   chroot#&gt; dpkg-reconfigure locales\r\n    (choose your locale. Probably should choose one of the en_US ones as well)\r\n\r\nI want to run some X program, so I just install xterm to get all the dependencies installed:\r\n\r\n      apt-get install xterm\r\n\r\nTo get X to work back to your parent slackware environment via a domain socket try:\r\n\r\nmount --bind \/tmp\/.X11-unix \/chroot\/tmp\/.X11-unix\r\n\r\nYou might have to create the \/chroot\/tmp\/.X11-unix first.<\/pre>\n<p>The main thing is to have those mounts set up before you chroot each time.<\/p>\n<p>I noticed after I did all that, that I could run xterm as root but not as a regular user. ie. After setting up all those mounts and going:<\/p>\n<pre>\r\nchroot \/chroot \/bin\/bash\r\nexport DISPLAY=:0\r\nxterm\r\n<\/pre>\n<p>The above worked, but something like the following did not (assuming the user kernel already exists):<\/p>\n<pre>\r\nchroot \/chroot \/bin\/bash\r\nsu - kernel\r\nexport DISPLAY=:0\r\nxterm\r\nxterm: Error 32, errno 2: No such file or directory\r\nReason: get_pty: not enough ptys\r\n<\/pre>\n<p>It turns out you need the \/dev\/pts thing mounted .I originally did it inside the chroot, but its easier if you do it outside it<\/p>\n<pre>\r\nmount --bind \/dev\/pts \/chroot\/dev\/pts\r\nchroot \/chroot \/bin\/bash\r\nsu - kernel\r\nexport DISPLAY=:0\r\nxterm\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>OK, so now that I&#8217;ve installed slackware 12.0 on this TP600X I was thinking about how I might get on if I converted my T42 back to slackware. Surely there&#8217;d be a heap of packages I&#8217;d miss. Sure I could compile from source. I used to do that years ago when I ran Slackware on [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":0,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/25\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/media?parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/categories?post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/tags?post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}