Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD support #34

Closed
HansRue opened this issue Nov 23, 2015 · 18 comments
Closed

FreeBSD support #34

HansRue opened this issue Nov 23, 2015 · 18 comments

Comments

@HansRue
Copy link

HansRue commented Nov 23, 2015

Hello,

and thanks for developing VeraCrypt.
FreeBSD gains more and more end users. Not only because of but with a lot of help from PC-BSD. It would be great to have VeraCrypt port in the ports collection of FreeBSD.
For me personally it would be great to have access to some of my in Windows encrypted HDDs. This would improve and extend this great multi platform encryption system.
Any thoughts on the Issue?

@idrassi
Copy link
Member

idrassi commented Nov 30, 2015

Hi,

Few months ago, I looked at the possibility of a FreeBSD port because there is already some code for it that is inherited from TrueCrypt.
The main issue I found is related to fuse: while FreeBSD 10 seems to have introduced Fuse recently, I was not able to make VeraCrypt work because the "fuse" executable called by VeraCrypt doesn't seem to exist (https://github.com/veracrypt/VeraCrypt/blob/master/src/Driver/Fuse/FuseService.cpp#L444)

I didn't spend a lot of time so maybe I missed something obvious. Any help from BSD developers would be much appreciated.

@jbeich
Copy link

jbeich commented Dec 1, 2015

Do you mean mount_fusefs(8)? That's what libfuse uses under the hood. On FreeBSD 9.x (and 8.x a few months back) mount_fusefs is provided via sysutils/fusefs-kmod port.

I was curious and built VeraCrypt but it worked fine as is. Looking closer at Process::Execute implementation it seems fuse would only be invoked if execFunctor == nullptr or maybe also if fuse_main() fails.

@HansRue
Copy link
Author

HansRue commented Dec 1, 2015

Hi idrassi,

It is good to hear that you already tried making it work. I forwarded info about this thread to the FreeBSD "ports" mailing list, as I'm not skilled enough to help you. Hopefully somebody knowledgeable chips in. :-)
It would be awesome if VeraCrypt encrypted containers and hard disks would be usable under FreeBSD.

This is the Link to the thread: https://lists.freebsd.org/pipermail/freebsd-ports/2015-December/101254.html

@engerim42
Copy link

I could compile it easily (but still have some problems with WXWidgets so no UI). For fuse there used to be "sysutils/fusefs-kmod" in Ports but its now built-in by default. So all you need to do is adding fuse_load="YES" into `/boot/loader.conf`` and reboot the system to be able to mount VeraCrypt files. I'll look into the UI issues.

@HansRue
Copy link
Author

HansRue commented Feb 11, 2016

@engerim42 It sounds great that you got it working. There is a official guide how to build VeraCrypt for Linux and Mac.
I hope it is not to much to ask but could you list the necessary FreeBSD ports to successfully compile. And if there are any deviations from the instructions for building under FreeBSD it would be great if you could provide some hints.
By the way, did you get the UI working?

@agilob
Copy link

agilob commented Aug 21, 2016

Any chance for progress on this?

@engerim42
Copy link

@agilob didn't have much time recently. if you follow my instructions above it should work well though (but without UI)

@cederom
Copy link

cederom commented Jan 6, 2017

+1 to make VeraCrypt work on FreeBSD! :-)

@microshaft
Copy link

microshaft commented Feb 15, 2017

There's only two line changes needed to the Makefile for VeraCrypt to build and, apparently, run just fine on FreeBSD 10.3 including UI support. I've always wanted to create a port...

@agilob
Copy link

agilob commented Feb 15, 2017

@microshaft please let us know if you're planning to make it and if so, when it's ready!

@microshaft
Copy link

@idrassi are you planning to release 1.20 soon? 1.19 doesn't build on FreeBSD but the current master does.

@idrassi
Copy link
Member

idrassi commented Feb 16, 2017

Yes, I'm planning to release 1.20 very soon. It was expected to come few weeks ago but I had some private issues that didn't allow me to work on it.

Moreover, I have a modification for FreeBSD 11 that I didn't commit yet related to compiler and filemanager detection. Below is a copy of the patch. I will push it as soon as possible.

Don't hesitate to share any modification that maybe needed.

---
 src/Main/UserInterface.cpp |  6 +++---
 src/Makefile               | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp
index fa2088f..c79cef2 100644
--- a/src/Main/UserInterface.cpp
+++ b/src/Main/UserInterface.cpp
@@ -838,12 +838,12 @@ namespace VeraCrypt
 #else
 		// MIME handler for directory seems to be unavailable through wxWidgets
 		wxString desktop = GetTraits()->GetDesktopEnvironment();
-		bool xdgOpenPresent = wxFileName::IsFileExecutable (wxT("/usr/bin/xdg-open"));
-		bool nautilusPresent = wxFileName::IsFileExecutable (wxT("/usr/bin/nautilus"));
+		bool xdgOpenPresent = wxFileName::IsFileExecutable (wxT("/usr/bin/xdg-open")) || wxFileName::IsFileExecutable (wxT("/usr/local/bin/xdg-open"));
+		bool nautilusPresent = wxFileName::IsFileExecutable (wxT("/usr/bin/nautilus")) || wxFileName::IsFileExecutable (wxT("/usr/local/bin/nautilus"));
 
 		if (desktop == L"GNOME" || (desktop.empty() && !xdgOpenPresent && nautilusPresent))
 		{
-			args.push_back ("--no-default-window");
+			// args.push_back ("--no-default-window"); // This option causes nautilus not to launch under FreeBSD 11
 			args.push_back ("--no-desktop");
 			args.push_back (string (path));
 			try
diff --git a/src/Makefile b/src/Makefile
index dea172f..1b71f27 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -285,6 +285,24 @@ ifeq "$(shell uname -s)" "FreeBSD"
 	PLATFORM := FreeBSD
 	PLATFORM_UNSUPPORTED := 1
 	C_CXX_FLAGS += -DTC_UNIX -DTC_BSD -DTC_FREEBSD
+	
+	CC := cc
+	CXX := c++
+
+	ifeq "$(SIMD_SUPPORTED)" "1"
+		CFLAGS += -msse2 -maes
+		CXXFLAGS += -msse2 -maes
+
+		ifeq "$(origin SSSE3)" "command line"
+			CFLAGS += -mssse3
+			CXXFLAGS += -mssse3
+		endif
+
+		ifeq "$(origin SSE41)" "command line"
+			CFLAGS += -mssse3 -msse4.1
+			CXXFLAGS += -mssse3 -msse4.1
+		endif
+	endif
 
 endif
 
-- 

@roggenkamps
Copy link

roggenkamps commented Feb 17, 2017 via email

@roggenkamps
Copy link

roggenkamps commented Mar 14, 2017

I just submitted the FreeBSD port for this:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217775

I'm not a committer, but you should be able to use the SVN diff I submitted with this bug to insert it into your ports tree under security/veracrypt.

I have not extensively tested this port, but I have been able to build it and run it successfully on an AMD powered FreeBSD 11 desktop as well as an Atom powered netbook running GhostBSD (FreeBSD 10.3-RELEASE).

I should also add that I did not incorporate the above code from @idrassi. The port is based on commit 100b79d from Jan 23.

@cederom
Copy link

cederom commented Mar 14, 2017

Awsome will try to verify in a free moment :-)

@LittleVulpix
Copy link

Having this on FreeBSD would be great since FreeNAS uses this as their OS of choice (and the latest, FreeNAS 11 is using FreeBSD11). I hope it will be possible to release this because my current workaround is amazingly bad - run a VM on the FreeNAS system, in this VM, run something like centos or ubuntu, use NFS/SMB to mount the volume and then work on the files :D but it's obviously super tedious and slow, not to mention the extra strain on system resources unlike a native program.

@idrassi welcome back, too!

@HansRue
Copy link
Author

HansRue commented Jul 19, 2017

Finally there is a FreeBSD Port now:
http://www.freshports.org/security/veracrypt/

Thanks to all people involved!

@cederom
Copy link

cederom commented Jul 19, 2017 via email

@idrassi idrassi closed this as completed Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants