{"id":25833,"date":"2022-10-19T19:06:33","date_gmt":"2022-10-19T18:06:33","guid":{"rendered":"https:\/\/ekiwi-blog.de\/?p=25833"},"modified":"2023-01-14T11:40:19","modified_gmt":"2023-01-14T10:40:19","slug":"include-onedrive-access-in-linux-with-rclone","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/25833\/include-onedrive-access-in-linux-with-rclone\/","title":{"rendered":"Mount OneDrive as folder in Linux with Rclone"},"content":{"rendered":"<p>How to use OneDrive in Linux.<\/p>\n<p><!--more--><\/p>\n<p>Linux and cloud services, not so easy. It feels like only Dropbox offers its own client. Google Drive and OneDrive do not offer their own clients. Presumably, the target group is simply not large enough or prefers to set up a NextCloud itself. I use OneDrive myself. <\/p>\n<p>Now I was looking for ways to access it. One solution is the software <a href=\"https:\/\/ekiwi-blog.de\/7837\/expandrive-onedrive-unter-linux-nutzen\/\" target=\"_blank\" rel=\"noopener\">ExpanDrive<\/a>. The software costs money, but offers support for all sorts of cloud services. Stupidly, the software did not want to work under <a href=\"https:\/\/www.opensuse.org\/\" target=\"_blank\" rel=\"noopener\">openSuse<\/a>.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of content<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ekiwi-blog.de\/en\/25833\/include-onedrive-access-in-linux-with-rclone\/#Video\" >Video<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ekiwi-blog.de\/en\/25833\/include-onedrive-access-in-linux-with-rclone\/#Rclone_access_to_cloud_services_for_Linux\" >Rclone access to cloud services for Linux<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ekiwi-blog.de\/en\/25833\/include-onedrive-access-in-linux-with-rclone\/#Setup_RClone_for_OneDrive\" >Setup RClone for OneDrive<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ekiwi-blog.de\/en\/25833\/include-onedrive-access-in-linux-with-rclone\/#Mount_OneDrive\" >Mount OneDrive<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ekiwi-blog.de\/en\/25833\/include-onedrive-access-in-linux-with-rclone\/#Notes_on_use\" >Notes on use<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Video\"><\/span>Video<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/UzQIKYZDlLI\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Rclone_access_to_cloud_services_for_Linux\"><\/span>Rclone access to cloud services for Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This is where Rclone comes in, a command line tool for accessing all sorts of cloud services. The tool allows you to mount cloud storage in Linux. In the approach shown here, we mount OneDrive in Linux. The files are online and are not stored locally.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Setup_RClone_for_OneDrive\"><\/span>Setup RClone for OneDrive<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Let&#8217;s start with the installation of Rclone. This is done under Linux with the following command:<\/p>\n<pre>\r\ncurl https:\/\/rclone.org\/install.sh | sudo bash\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_1.png\" alt=\"\" width=\"643\" height=\"98\" class=\"aligncenter size-full wp-image-25802\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_1.png 643w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_1-300x46.png 300w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/p>\n<p>Once this is done, we can set up Rclone and configure OneDrive:<\/p>\n<pre>\r\nrclone config\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_2.png\" alt=\"\" width=\"642\" height=\"127\" class=\"aligncenter size-full wp-image-25804\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_2.png 642w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_2-300x59.png 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/p>\n<p>With &#8220;n&#8221; we create a new &#8220;Remote&#8221;. This is followed by a list of supported services. As we can see here, numerous other cloud services can be integrated in addition to OneDrive.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_3.png\" alt=\"\" width=\"286\" height=\"128\" class=\"aligncenter size-full wp-image-25806\" \/><\/p>\n<p>OneDrive is number 32. Further questions follow, e.g. for the &#8220;client_id&#8221; or the &#8220;client_secret&#8221;. We do not have to specify either of these things and simply confirm them with Enter.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_4.png\" alt=\"\" width=\"370\" height=\"219\" class=\"aligncenter size-full wp-image-25808\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_4.png 370w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_4-300x178.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p>A query about the region follows. Here we also simply select the first option &#8220;Microsoft Cloud Global&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_5.png\" alt=\"\" width=\"452\" height=\"209\" class=\"aligncenter size-full wp-image-25810\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_5.png 452w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_5-300x139.png 300w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/p>\n<p>When asked for &#8220;advanced config&#8221; we press &#8220;n&#8221; for No. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_6.png\" alt=\"\" width=\"203\" height=\"100\" class=\"aligncenter size-full wp-image-25812\" \/><\/p>\n<p>Also in the next step we choose the path of least resistance and select the &#8220;auto config&#8221; with &#8220;Yes&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_7.png\" alt=\"\" width=\"483\" height=\"120\" class=\"aligncenter size-full wp-image-25814\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_7.png 483w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_7-300x75.png 300w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><\/p>\n<p>This will now open a browser window. Here we now have to log in to Microsoft and grant Rclone the access rights.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_8.png\" alt=\"\" width=\"529\" height=\"343\" class=\"aligncenter size-full wp-image-25816\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_8.png 529w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_8-300x195.png 300w\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" \/><\/p>\n<p>Another prompt appears, this time asking for the type of connection. Here we select 1, &#8220;OneDrive Personal or Business&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_9.png\" alt=\"\" width=\"537\" height=\"326\" class=\"aligncenter size-full wp-image-25818\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_9.png 537w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_9-300x182.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/p>\n<p>In the next step, our OneDrive, along with ID is displayed. Here we confirm the number of the account. Normally only one is displayed, so enter 1.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_10.png\" alt=\"\" width=\"459\" height=\"115\" class=\"aligncenter size-full wp-image-25820\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_10.png 459w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_10-300x75.png 300w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><\/p>\n<p>If everything has worked, this is displayed in the form of the URL and ID. Here we select &#8220;Yes&#8221; again that everything fits.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_11.png\" alt=\"\" width=\"410\" height=\"125\" class=\"aligncenter size-full wp-image-25822\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_11.png 410w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_11-300x91.png 300w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/p>\n<p>If everything is correct, we confirm this in the last step with Enter, or Yes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_12.png\" alt=\"\" width=\"231\" height=\"76\" class=\"aligncenter size-full wp-image-25824\" \/><\/p>\n<p>Done! OneDrive is now configured and ready to use.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_13.png\" alt=\"\" width=\"287\" height=\"235\" class=\"aligncenter size-full wp-image-25826\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Mount_OneDrive\"><\/span>Mount OneDrive<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In order to use OneDrive, we need to mount it. To do this, we create a folder, for example in the home directory with the name &#8220;OneDrive&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_14.png\" alt=\"\" width=\"373\" height=\"178\" class=\"aligncenter size-full wp-image-25828\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_14.png 373w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_14-300x143.png 300w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/p>\n<p>After that, we can mount OneDrive to the folder, using the following command:<\/p>\n<pre>\r\nrclone --vfs-cache-mode writes mount onedrive: ~\/OneDrive\r\n<\/pre>\n<p>At every restart the thing is gone, who wants can build a script from it and put it in the autostart. <\/p>\n<p>In the folder &#8220;OneDrive&#8221; we can now access our OneDrive files.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_15.png\" alt=\"\" width=\"857\" height=\"531\" class=\"aligncenter size-full wp-image-25830\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_15.png 857w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_15-300x186.png 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2022\/10\/rclone_15-768x476.png 768w\" sizes=\"auto, (max-width: 857px) 100vw, 857px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Notes_on_use\"><\/span>Notes on use<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>There is not so much to consider when using it. The synchronization takes place in the background. However, everything is online, the files are not stored on the computer. So an internet connection is mandatory.<\/p>\n<p>The upload and download takes place in the background. For larger files, the process takes a little time, so you should make sure that the upload is completed before the computer is turned off.<\/p>","protected":false},"excerpt":{"rendered":"<p>How to use OneDrive in Linux.<\/p>\n","protected":false},"author":1,"featured_media":15249,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[2023,1682,2443,2359],"class_list":["post-25833","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-cloud-en","tag-linux-en","tag-linux-en-2","tag-rclone"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/25833","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=25833"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/25833\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/15249"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=25833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=25833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=25833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}